I assume that this is a new bug, because there was no response on the freebsd-fs mailing list. Moving directories around in unionfs mounts isn't handled correctly as can be seen from the long example below. It behaves the same if there is no "-o below" parameter. This one makes files appear. Fix: For this problem 2 I see solutions: - in all cases (option whiteout=always or whenneeded) when new directories get created unionfs should check whether such a directory exists in the lower layer and automaticly whiteout all of its entries - or better (can not work for more than 2 layers) copying all files to upper layer in the moved directory and set the opaque flag, so that underlying files under the new directory name can't be seen through (with other words set opaque on new directory and copy all files in it) Any better idea? How-To-Repeat: Create original directory hierarchy: ~# mkdir rw ro ro/orig ~# touch ro/orig/file ro/orig/file2 ~# mount -t unionfs -o below ro rw ~# cd rw ~/rw# ls -aFloWi total 6 49874 drwx------ 3 root wheel - 512 Aug 12 01:32 ./ 49872 drwx------ 4 root wheel - 512 Aug 12 01:20 ../ 49878 drwx------ 2 root wheel - 512 Aug 12 01:20 orig/ ~/rw# ls -aFloWi orig/ total 4 49878 drwx------ 2 root wheel - 512 Aug 12 01:20 ./ 49874 drwx------ 3 root wheel - 512 Aug 12 01:32 ../ 49876 -rw------- 1 root wheel - 0 Aug 12 01:20 file 49877 -rw------- 1 root wheel - 0 Aug 12 01:20 file2 Lets test something (it creates in upper layer): ~/rw# mkdir new ~/rw# touch new/newfile ~/rw# ls -aFloWi total 8 49874 drwx------ 4 root wheel - 512 Aug 12 02:04 ./ 49872 drwx------ 4 root wheel - 512 Aug 12 02:03 ../ 49879 drwx------ 2 root wheel - 512 Aug 12 02:04 new/ 49878 drwx------ 2 root wheel - 512 Aug 12 01:20 orig/ ~/rw# ls -aFloWi new total 4 49879 drwx------ 2 root wheel - 512 Aug 12 02:04 ./ 49874 drwx------ 4 root wheel - 512 Aug 12 02:04 ../ 49880 -rw------- 1 root wheel - 0 Aug 12 02:04 newfile ~/rw# ls -aFloWi orig total 4 49878 drwx------ 2 root wheel - 512 Aug 12 01:20 ./ 49874 drwx------ 4 root wheel - 512 Aug 12 02:04 ../ 49876 -rw------- 1 root wheel - 0 Aug 12 01:20 file 49877 -rw------- 1 root wheel - 0 Aug 12 01:20 file2 And lets see if there is another problem: ~/rw# rm -rf orig ~/rw# ls -aFloWi total 6 49874 drwx------ 3 root wheel - 512 Aug 12 02:06 ./ 49872 drwx------ 4 root wheel - 512 Aug 12 02:03 ../ 49879 drwx------ 2 root wheel - 512 Aug 12 02:06 new/ 0 w--------- 0 root wheel - 0 Jan 1 1970 orig% ~/rw# mv new orig ~/rw# ls -aFloWi total 6 49874 drwx------ 3 root wheel - 512 Aug 12 02:07 ./ 49872 drwx------ 4 root wheel - 512 Aug 12 02:03 ../ 49879 drwx------ 2 root wheel - 512 Aug 12 02:06 orig/ Looks fine till now, but (files appear from nowhere): ~/rw# ls -aFloWi orig total 4 49879 drwx------ 2 root wheel - 512 Aug 12 02:06 ./ 49874 drwx------ 3 root wheel - 512 Aug 12 02:07 ../ 49876 -rw------- 1 root wheel - 0 Aug 12 01:20 file 49877 -rw------- 1 root wheel - 0 Aug 12 01:20 file2 49880 -rw------- 1 root wheel - 0 Aug 12 02:05 newfile << WTF!??? PROBLEM 2
Responsible Changed From-To: freebsd-bugs->daichi Over to maintainer.
State Changed From-To: open->open commit bit has been taken in for safekeeping.
Responsible Changed From-To: daichi->freebsd-fs
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped