Hello, all.
I am afraid this is a bug of unionfs rmdir(2). I have found this while I
was debugging Klaus's mv(1) problem.
there is a directory d_dst and d_dst/d under ro.
# mount -t unionfs -o dirs=rw=rw:ro=ro none u
# cd u
# rm -fr d_dst
# mkdir -p d_dst/d
Then find(1) prints like this. this is what I expected.
1472 2 dr-xr-xr-x ro
1536 2 dr-xr-xr-x ro/d_dst
1600 2 dr-xr-xr-x ro/d_dst/d
826 0 drwxrwxrwt rw
851 0 drwxr-xr-x rw/d_dst
853 0 drwxr-xr-x rw/d_dst/d
854 0 -rw------- rw/d_dst/d/.wh.__dir_opaque
852 0 -rw------- rw/d_dst/.wh.__dir_opaque
996 0 drwxrwxrwt u
1000 0 drwxr-xr-x u/d_dst
1001 0 drwxr-xr-x u/d_dst/d
But next rm(1) failed.
# rm -fr d_dst
rm: cannot remove directory `d_dst': Directory not empty
rmdir(2) should create whiteout even when the target entry is on
writable branch, since the same entry might be on the other branches.
Here is a patch.
Junjiro Okajima
diff -u -r1.1 unlink.c
--- unionfs-20050923-1803/unlink.c 26 Sep 2005 11:12:24 -0000 1.1
+++ unionfs-20050923-1803/unlink.c 26 Sep 2005 12:32:31 -0000
@@ -332,7 +332,8 @@
} else {
err = create_whiteout(dentry, dbstart(dentry));
}
- }
+ } else
+ err = create_whiteout(dentry, dbstart(dentry));
out:
/* propagate number of hard-links */
_______________________________________________
unionfs mailing list
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs