Skip to content

Commit

Permalink
Disable writeback cache for now
Browse files Browse the repository at this point in the history
Writeback cache seems to cause dataloss in some situations.
We need to investigate this first.

See #72.
  • Loading branch information
Nikratio committed Aug 4, 2017
1 parent 44a56f0 commit 1e6e067
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.rst
@@ -1,6 +1,10 @@
Unreleased Changes
------------------

* Temporarily disabled the writeback cache feature, since there
have been reports of dataloss when appending to files when
writeback caching is enabled.

* Fixed a crash due to a race condition when listing
directory contents.

Expand Down
8 changes: 6 additions & 2 deletions sshfs.c
Expand Up @@ -3852,7 +3852,7 @@ int main(int argc, char *argv[])
sshfs.wfd = -1;
sshfs.ptyfd = -1;
sshfs.dir_cache = 1;
sshfs.writeback_cache = 1;
sshfs.writeback_cache = 0;
sshfs.show_help = 0;
sshfs.show_version = 0;
sshfs.singlethread = 0;
Expand Down Expand Up @@ -3900,7 +3900,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "see `%s -h' for usage\n", argv[0]);
exit(1);
}


if(sshfs.writeback_cache)
printf("NOTICE: writeback cache is disabled in this release due to potential\n"
"dataloss. It will be re-enabled in a future SSHFS release.\n");

if (sshfs.idmap == IDMAP_USER)
sshfs.detect_uid = 1;
else if (sshfs.idmap == IDMAP_FILE) {
Expand Down

0 comments on commit 1e6e067

Please sign in to comment.