mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-11 00:09:03 -04:00
fuse-overlayfs: skip whiteouts when comparing hardlinks during a rename
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
382b0d8e0c
commit
f58a9c452e
6
main.c
6
main.c
@ -2481,7 +2481,7 @@ ovl_rename (fuse_req_t req, fuse_ino_t parent, const char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (destnode != NULL && node_dirp (destnode))
|
if (destnode != NULL && !destnode->whiteout && node_dirp (destnode))
|
||||||
{
|
{
|
||||||
errno = EISDIR;
|
errno = EISDIR;
|
||||||
goto error;
|
goto error;
|
||||||
@ -2490,7 +2490,7 @@ ovl_rename (fuse_req_t req, fuse_ino_t parent, const char *name,
|
|||||||
rm = hash_lookup (destpnode->children, &key);
|
rm = hash_lookup (destpnode->children, &key);
|
||||||
if (rm)
|
if (rm)
|
||||||
{
|
{
|
||||||
if (rm->ino == node->ino)
|
if (!rm->whiteout && rm->ino == node->ino)
|
||||||
{
|
{
|
||||||
fuse_reply_err (req, 0);
|
fuse_reply_err (req, 0);
|
||||||
return;
|
return;
|
||||||
@ -2562,6 +2562,8 @@ ovl_rename (fuse_req_t req, fuse_ino_t parent, const char *name,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
unlinkat (destfd, newname, 0);
|
||||||
|
|
||||||
/* Try to create the whiteout atomically, if it fails do the
|
/* Try to create the whiteout atomically, if it fails do the
|
||||||
rename+mknod separately. */
|
rename+mknod separately. */
|
||||||
ret = syscall (SYS_renameat2, srcfd, name, destfd,
|
ret = syscall (SYS_renameat2, srcfd, name, destfd,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user