Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants