You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With copy-on-write enabled, I am noticing that certain files are being written to a read only branch. This seems to have something to do with the fact that the files are located on an NFS share.
As far as I can tell, the problem seems to be that the first file written to a directory that does not exist in the read-write branch, but does exist in the read-only branch, is written to both branches. I haven't been able to pinpoint all the situations where this does or does not occur, but I created a script that demonstrates some interesting cases.
#!/bin/bash
mkdir lower upper union
# Cases 1 and 2
mkdir -p lower/dir1 lower/dir2
# Case 4
mkdir -p upper/dir4
unionfs -ocow,debug_file=debug.log upper=RW:lower=RO union
# Case 1
touch union/dir1/file.txt
touch union/dir1/file2.txt
# Case 2
touch union/dir2/file.txt
touch union/dir2/file2.txt
# Case 3
mkdir -p union/dir3
touch union/dir3/file.txt
# Case 4
touch union/dir4/file.txt
tree lower
echo
tree upper
echo
tree union
fusermount -u union
Case 1 and 2: Before mounting, the dir1 and dir2 exist in lower, but not upper. This causes the first file created in each directory to be written to lower, the read-only branch, which is incorrect behavior
Case 3: Before mounting, dir3 does not exist in either branch. After mounting, it is created and is correctly written only to upper.
Case 4: Before mounting, dir4 exists only in upper. After mounting, when a file is written to it, the file is correctly created within upper.
I believe the problem is related to NFS because the test script works correctly on my laptop as well as in a tmpfs on the system where I am experiencing the problem.
Here is the debug log created while running the script (name of NFS share and username have been redacted) as well as the output of the script:
thanks for such detailed bug report! i'll gladly investigate it but do you have any idea how to create a nfs testbed (on localhost) in the most straightforward way? ideally, such that would work in travis (ubuntu based) as well?
I cannot reproduce this on unionfs-fuse 3.2 using NFS. A case was recently fixed (#128) where writes could happen in a read-only branch. Can you still reproduce this?
With copy-on-write enabled, I am noticing that certain files are being written to a read only branch. This seems to have something to do with the fact that the files are located on an NFS share.
As far as I can tell, the problem seems to be that the first file written to a directory that does not exist in the read-write branch, but does exist in the read-only branch, is written to both branches. I haven't been able to pinpoint all the situations where this does or does not occur, but I created a script that demonstrates some interesting cases.
dir1
anddir2
exist inlower
, but notupper
. This causes the first file created in each directory to be written tolower
, the read-only branch, which is incorrect behaviordir3
does not exist in either branch. After mounting, it is created and is correctly written only toupper
.dir4
exists only inupper
. After mounting, when a file is written to it, the file is correctly created withinupper
.I believe the problem is related to NFS because the test script works correctly on my laptop as well as in a tmpfs on the system where I am experiencing the problem.
Here is the debug log created while running the script (name of NFS share and username have been redacted) as well as the output of the script:
Here is the expected output (running in a tmpfs) and debug log:
The text was updated successfully, but these errors were encountered: