Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append to file broken #72

Closed
hsandmeyer opened this issue Jul 17, 2017 · 6 comments
Closed

Append to file broken #72

hsandmeyer opened this issue Jul 17, 2017 · 6 comments
Assignees
Labels

Comments

@hsandmeyer
Copy link

I can not append to files any more. In the mounted directory:

$ echo foo > test.txt
$ echo bar >> test.txt
$ cat test.txt
bar

Same happens using other programs than the shell

System is arch-linux with newest updates.

sshfs --version

SSHFS version 3.0.0
FUSE library version 3.1.0
using FUSE kernel interface version 7.26
fusermount3 version: 3.1.0
@myagues
Copy link

myagues commented Jul 18, 2017

Try disabling writeback_cache with -o writeback_cache=no.

@hsandmeyer
Copy link
Author

Thank you. That helps

@Nikratio Nikratio self-assigned this Aug 3, 2017
@Nikratio Nikratio added the bug label Aug 3, 2017
@Nikratio
Copy link
Contributor

Nikratio commented Aug 3, 2017

Thanks for the report! I will look into it ASAP.

@Nikratio
Copy link
Contributor

Nikratio commented Aug 3, 2017

A very similar problem with append operations is actually present in the passthrough_fh example that comes with libfuse itself. If writeback cache is enabled, we get:

$ echo foo > test.txt
$ echo bar >> test.txt
bash: echo: write error: Bad file descriptor
$ cat test.txt 
foo

Nikratio added a commit that referenced this issue Aug 4, 2017
Writeback cache seems to cause dataloss in some situations.
We need to investigate this first.

See #72.
@Nikratio
Copy link
Contributor

Nikratio commented Aug 6, 2017

Alright, so the problem is that SSHFS opens the file write-only, but writeback cache requires the ability to read the file. Opening read-write fixes the problem.

But the important question is: why aren't we getting an error from the remote server when trying to read from a write-only file? This is what's responsible for getting silent data corruptions instead of an error on the second write.

@Nikratio
Copy link
Contributor

Nikratio commented Aug 6, 2017

Reported the issue to the openssh folks. Should soon show up on https://marc.info/?l=openssh-unix-dev&r=1&b=201708&w=2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants