libfuse / sshfs

A network filesystem client to connect to SSH servers
GNU General Public License v2.0
5.93k stars 496 forks source link

cp's "same file check" not working on SSHFS mountpoints #262

Open mgutt opened 3 years ago

mgutt commented 3 years ago

Usually it's not possible to overwrite a file by itself:

# echo "test" > ./test.txt
# cp ./test.txt ./test.txt
cp: './test.txt' and './test.txt' are the same file

This is also valid for mounted paths:

# mkdir ./src
# echo "test" > ./src/test.txt
# mkdir ./src_mounted
# mount --bind ./src ./src_mounted
# cp ./src/test.txt ./src_mounted/test.txt
cp: './src/test.txt' and './src_mounted/test.txt' are the same file

But with SSHFS the file is emptied:

# sshfs root@localhost:./src /.src_mounted
# cp ./src/test.txt ./src_mounted/test.txt
# cat ./src/test.txt # no output, file is empty

This is a huge problem for users of Unraid OS (as they don't know that two different paths can contain the same files).

Nikratio commented 3 years ago

Thanks for taking the time to report this issue!

Unfortunately, this project does not currently have any active, regular contributors. As the maintainer, I try to review pull requests and make regular releases, but unfortunately I have no capacity to do significant development beyond that. Issue reports that do not come with a pull request or clearly have high impact on a large number of users are therefore likely to languish.

I understand that this is frustrating for users, but I hope you can also understand that any development work that I do on this project has to compete with spending time with my family, doing work that I get paid for, doing something recreational without a computer, or working on features/bugs that affect me personally. Most bugs and ideas - unfortunately including this one - loose out in this competition.

In other words, unless you plan to work on this yourself or can recruit someone who will, it's unlikely that anyone is going to do anything about it anytime soon.

This is just to calibrate expectations. I am grateful that you took the time and effort to report this! I'll leave this issue open to document the problem and who knows, maybe someone will pick it up after all :-).