mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-08-03 18:05:58 -04:00
main: honor FUSE_OVERLAYFS_DISABLE_OVL_WHITEOUT also for renames
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
0d77a9fdd0
commit
062ec18711
14
main.c
14
main.c
@ -4532,9 +4532,17 @@ ovl_rename_direct (fuse_req_t req, fuse_ino_t parent, const char *name,
|
||||
|
||||
/* Try to create the whiteout atomically, if it fails do the
|
||||
rename+mknod separately. */
|
||||
ret = direct_renameat2 (srcfd, name, destfd,
|
||||
newname, flags|RENAME_WHITEOUT);
|
||||
/* If the destination is a whiteout, just overwrite it. */
|
||||
if (! can_mknod)
|
||||
{
|
||||
ret = -1;
|
||||
errno = EPERM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = direct_renameat2 (srcfd, name, destfd,
|
||||
newname, flags|RENAME_WHITEOUT);
|
||||
}
|
||||
/* If the destination is a whiteout, just overwrite it. */
|
||||
if (ret < 0 && errno == EEXIST)
|
||||
ret = direct_renameat2 (srcfd, name, destfd, newname, flags & ~RENAME_NOREPLACE);
|
||||
if (ret < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user