rpodgorny / unionfs-fuse

union filesystem using fuse
Other
309 stars 76 forks source link

The file size shows incorrect size when copy-up (cow) is in progress #69

Open pralaydak opened 7 years ago

pralaydak commented 7 years ago

While working on my cow-optimized feature (cowolf) I found an issue today.

When copy-up (copying file from lower branch to upper branch) is in progress, doing "ls" shows incorrect file size (it shows the size it copied so far). As expected, it happens for large files when it takes longer time to copy (on the top of that, I have a very slow NFS mount).

I made some fix (which solves my problem). In this fix, it creates a "_COPYUP~" metafile to indicates copy-up-in-progress. But most likely this fix does not address other corner cases. For example, two simultaneous write() operations taking places and both triggering copy-up.

Here, the fix: https://github.com/pralaydak/unionfs-fuse/tree/copyup_fix

There is test script test_copyup.py included as well.