Merge pull request #369 from giuseppe/fix-copy-range-deleted-file

main: fix copy_file_range for deleted files
This commit is contained in:
Giuseppe Scrivano 2022-08-25 22:55:02 +02:00 committed by GitHub
commit 1d4d97c55a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
main.c
View File

@ -5394,7 +5394,10 @@ ovl_copy_file_range (fuse_req_t req, fuse_ino_t ino_in, off_t off_in, struct fus
return;
}
fd = node->layer->ds->openat (node->layer, node->path, O_NONBLOCK|O_NOFOLLOW|O_RDONLY, 0755);
if (node->hidden)
fd = openat (node->hidden_dirfd, node->path, O_NONBLOCK|O_NOFOLLOW|O_RDONLY, 0755);
else
fd = node->layer->ds->openat (node->layer, node->path, O_NONBLOCK|O_NOFOLLOW|O_RDONLY, 0755);
if (fd < 0)
{
fuse_reply_err (req, errno);