mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-08-04 02:15: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
8
main.c
8
main.c
@ -4532,8 +4532,16 @@ 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
|
/* Try to create the whiteout atomically, if it fails do the
|
||||||
rename+mknod separately. */
|
rename+mknod separately. */
|
||||||
|
if (! can_mknod)
|
||||||
|
{
|
||||||
|
ret = -1;
|
||||||
|
errno = EPERM;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ret = direct_renameat2 (srcfd, name, destfd,
|
ret = direct_renameat2 (srcfd, name, destfd,
|
||||||
newname, flags|RENAME_WHITEOUT);
|
newname, flags|RENAME_WHITEOUT);
|
||||||
|
}
|
||||||
/* If the destination is a whiteout, just overwrite it. */
|
/* If the destination is a whiteout, just overwrite it. */
|
||||||
if (ret < 0 && errno == EEXIST)
|
if (ret < 0 && errno == EEXIST)
|
||||||
ret = direct_renameat2 (srcfd, name, destfd, newname, flags & ~RENAME_NOREPLACE);
|
ret = direct_renameat2 (srcfd, name, destfd, newname, flags & ~RENAME_NOREPLACE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user