rpodgorny / unionfs-fuse

union filesystem using fuse
Other
309 stars 76 forks source link

Directory rename hides files #91

Open ypsu opened 4 years ago

ypsu commented 4 years ago

Here's a repro:

$ mkdir -p ro rw union ro/dir
$ unionfs -o cow rw=RW:ro=RO union
$ touch ro/dir/{f1,f2,f3}
$ cd union
$ ls dir
f1
f2
f3
$ echo hello >dir/f2
$ mv dir otherdir
$ ls otherdir
f2
$ cd ..
$ fusermount -u union

The second ls doesn't show f1 and f3, only f2 that I have modified. The most annoying thing is that this happens completely silently, one has to be lucky to notice such file disappearance. Not sure I understand how complicated the problem is, but I'd be happy if such a rename would just error out rather than work erroneously. :(

I've checked previous issues (#23, #25, #27) but I couldn't really tell if it's the same problem or not so I thought I create a separate issue for this.

bsbernd commented 4 years ago

Ok hmm, so dir/f2 have been copied to the rw layer and the rename only touches that layer. The correct behavior probably would be to copy over the remaining files on rename. Bailing out might be an option, but I don't know if this wouldn't break things like systemd.

bsbernd commented 4 years ago

Thanks for the pointers, I think #25 is related. I need to go through all the git issues, I'm just as time limited as usual. I will try to fix this issue here during the next days.

Thanks, Bernd