mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-08-03 18:05:58 -04:00
main: mark directory not loaded on rename
if a whiteout was created as part of a rename operation, mark the directory content as not loaded so to avoid some optimizations when a whiteout file must be deleted. Closes: https://github.com/containers/fuse-overlayfs/issues/279 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
062ec18711
commit
d612d48326
2
main.c
2
main.c
@ -4555,6 +4555,8 @@ ovl_rename_direct (fuse_req_t req, fuse_ino_t parent, const char *name,
|
||||
ret = create_whiteout (lo, pnode, name, false, true);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
pnode->loaded = 0;
|
||||
}
|
||||
|
||||
if (delete_whiteout (lo, destfd, NULL, newname) < 0)
|
||||
|
@ -211,3 +211,20 @@ touch merged/a merged/b
|
||||
chmod 6 merged/a
|
||||
mv merged/a merged/x
|
||||
mv merged/b merged/a
|
||||
|
||||
# https://github.com/containers/fuse-overlayfs/issues/279
|
||||
umount -l merged
|
||||
|
||||
rm -rf lower upper workdir merged
|
||||
mkdir lower upper workdir merged
|
||||
mkdir lower/test
|
||||
touch lower/test/a.txt
|
||||
|
||||
fuse-overlayfs -o lowerdir=lower,upperdir=upper,workdir=workdir merged
|
||||
|
||||
(cd merged/test; touch a.txt; mv a.txt a2.txt; touch a3.txt; ln -s a3.txt a.txt)
|
||||
|
||||
if test -e upperdir/test/.wh.a.txt; then
|
||||
echo "whiteout file still exists" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user