aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/bindfs.113
-rw-r--r--src/bindfs.c7
3 files changed, 21 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index de3ad04..01f1266 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-07-12 Martin Pärtel <martin dot partel at gmail dot com>
+
+ * Reverted change in 1.16.0 that made direct_io the default.
+ It turned out to be more problematic than not having it.
+ (issue #117, thanks @DUOLabs333 and @Misterio77)
+
2022-06-24 Martin Pärtel <martin dot partel at gmail dot com>
* Added --map-{passwd,group}-rev
diff --git a/src/bindfs.1 b/src/bindfs.1
index 7cb13d0..3c2f92b 100644
--- a/src/bindfs.1
+++ b/src/bindfs.1
@@ -410,12 +410,17 @@ otherwise thread-safe, there is currently a race condition that may pose
a security risk for some use cases. See \fB\%BUGS\fP below.
.TP
+.B \-\-direct\-io, \-o direct\-io
+
+Forwards each read/write operation 1:1 to the underlying FS,
+disabling batching and caching by the kernel. Some applications may
+require this, however it may be incompatible with other applications,
+as currently it has issues with \fBmmap\fP(2) calls, at least.
+
+.TP
.B \-\-no\-direct\-io, \-o no\-direct\-io
-By default, each read/write operation is forwarded 1:1 to the underlying FS,
-disabling batching and caching by the kernel. Specify this option for default
-FUSE behaviour, which may be more performant with some applications but
-incompatible with others.
+This option is provided in case the default changes in the future.
.TP
.B \-\-forward\-odirect=\fIalignment\fP, \-o forward\-odirect=\fIalignment\fP
diff --git a/src/bindfs.c b/src/bindfs.c
index d373fc2..13695de 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -1801,6 +1801,7 @@ enum OptionKey {
OPTKEY_HIDE_HARD_LINKS,
OPTKEY_RESOLVE_SYMLINKS,
OPTKEY_BLOCK_DEVICES_AS_FILES,
+ OPTKEY_DIRECT_IO,
OPTKEY_NO_DIRECT_IO
};
@@ -1910,6 +1911,9 @@ static int process_option(void *data, const char *arg, int key,
settings.block_devices_as_files = 1;
return 0;
#ifdef __linux__
+ case OPTKEY_DIRECT_IO:
+ settings.direct_io = true;
+ return 0;
case OPTKEY_NO_DIRECT_IO:
settings.direct_io = false;
return 0;
@@ -2408,6 +2412,7 @@ int main(int argc, char *argv[])
OPT2("--delete-deny", "delete-deny", OPTKEY_DELETE_DENY),
OPT2("--rename-deny", "rename-deny", OPTKEY_RENAME_DENY),
#ifdef __linux__
+ OPT2("--direct-io", "direct-io", OPTKEY_DIRECT_IO),
OPT2("--no-direct-io", "no-direct-io", OPTKEY_NO_DIRECT_IO),
#endif
@@ -2477,7 +2482,7 @@ int main(int argc, char *argv[])
#ifdef __linux__
settings.forward_odirect = 0;
settings.odirect_alignment = 0;
- settings.direct_io = true;
+ settings.direct_io = false;
#endif
atexit(&atexit_func);