mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-09 15:24:54 -04:00
main: fix fallocate for deleted files
allow to use fallocate on an unlinked path if there is still a reference to it. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
e01ba30da5
commit
dfea3f9b63
4
main.c
4
main.c
@ -4719,6 +4719,7 @@ ovl_fallocate (fuse_req_t req, fuse_ino_t ino, int mode, off_t offset, off_t len
|
||||
struct ovl_data *lo = ovl_data (req);
|
||||
cleanup_close int fd = -1;
|
||||
struct ovl_node *node;
|
||||
int dirfd;
|
||||
int ret;
|
||||
|
||||
if (UNLIKELY (ovl_debug (req)))
|
||||
@ -4739,7 +4740,8 @@ ovl_fallocate (fuse_req_t req, fuse_ino_t ino, int mode, off_t offset, off_t len
|
||||
return;
|
||||
}
|
||||
|
||||
fd = node->layer->ds->openat (node->layer, node->path, O_NONBLOCK|O_NOFOLLOW|O_WRONLY, 0755);
|
||||
dirfd = node_dirfd (node);
|
||||
fd = openat (dirfd, node->path, O_NONBLOCK|O_NOFOLLOW|O_WRONLY, 0755);
|
||||
if (fd < 0)
|
||||
{
|
||||
fuse_reply_err (req, errno);
|
||||
|
Loading…
x
Reference in New Issue
Block a user