mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-08 14:52:31 -04:00
Merge pull request #309 from sipsma/whiteout-in-opaque
Don't create whiteout files in opaque dirs.
This commit is contained in:
commit
c45d315d19
4
main.c
4
main.c
@ -1065,6 +1065,10 @@ hide_node (struct ovl_data *lo, struct ovl_node *node, bool unlink_src)
|
||||
needs_whiteout = true;
|
||||
}
|
||||
|
||||
// if the parent directory is opaque, there's no need to put a whiteout in it.
|
||||
if (node->parent != NULL)
|
||||
needs_whiteout = needs_whiteout && (is_directory_opaque(get_upper_layer(lo), node->parent->path) < 1);
|
||||
|
||||
if (needs_whiteout)
|
||||
{
|
||||
/* If the atomic rename+mknod failed, then fallback into doing it in two steps. */
|
||||
|
@ -231,3 +231,20 @@ if test -e upperdir/test/.wh.a.txt; then
|
||||
echo "whiteout file still exists" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# https://github.com/containers/fuse-overlayfs/issues/306
|
||||
umount -l merged
|
||||
|
||||
rm -rf lower upper workdir merged
|
||||
mkdir lower upper workdir merged
|
||||
|
||||
mkdir -p lower/a/b
|
||||
fuse-overlayfs -o lowerdir=lower,upperdir=upper,workdir=workdir merged
|
||||
|
||||
rm -rf merged/a
|
||||
mkdir -p merged/a/b
|
||||
rm -rf merged/a/b
|
||||
test \! -e upper/a/b
|
||||
|
||||
umount merged
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user