aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.rst10
-rw-r--r--include/fuse_common.h19
-rw-r--r--lib/fuse_lowlevel.c3
3 files changed, 27 insertions, 5 deletions
diff --git a/ChangeLog.rst b/ChangeLog.rst
index af01d78..3d5c05b 100644
--- a/ChangeLog.rst
+++ b/ChangeLog.rst
@@ -1,3 +1,13 @@
+Unreleased Changes
+=================
+
+* The FUSE_CAP_READDIRPLUS_AUTO capability is no longer enabled by
+ default unless the file system defines both a readdir() and a
+ readdirplus() handler.
+
+* The description of the FUSE_CAP_READDIRPLUS_AUTO flag has been
+ improved.
+
libfuse 3.2.6 (2018-08-31)
==========================
diff --git a/include/fuse_common.h b/include/fuse_common.h
index 29ad339..83c9dee 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -219,7 +219,7 @@ struct fuse_loop_config {
#define FUSE_CAP_AUTO_INVAL_DATA (1 << 12)
/**
- * Indicates that the filesystem supports readdirplus
+ * Indicates that the filesystem supports readdirplus.
*
* This feature is enabled by default when supported by the kernel and if the
* filesystem implements a readdirplus() handler.
@@ -227,10 +227,21 @@ struct fuse_loop_config {
#define FUSE_CAP_READDIRPLUS (1 << 13)
/**
- * Indicates that the filesystem supports adaptive readdirplus
+ * Indicates that the filesystem supports adaptive readdirplus.
*
- * This feature is enabled by default when supported by the kernel and if the
- * filesystem implements a readdirplus() handler.
+ * If FUSE_CAP_READDIRPLUS is not set, this flag has no effect.
+ *
+ * If FUSE_CAP_READDIRPLUS is set and this flag is not set, the kernel
+ * will always issue readdirplus() requests to retrieve directory
+ * contents.
+ *
+ * If FUSE_CAP_READDIRPLUS is set and this flag is set, the kernel
+ * will issue both readdir() and readdirplus() requests, depending on
+ * how much information is expected to be required.
+ *
+ * This feature is enabled by default when supported by the kernel and
+ * if the filesystem implements both a readdirplus() and a readdir()
+ * handler.
*/
#define FUSE_CAP_READDIRPLUS_AUTO (1 << 14)
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index c426b7c..e6e3d8d 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -1918,7 +1918,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
FUSE_CAP_POSIX_LOCKS);
LL_SET_DEFAULT(se->op.flock, FUSE_CAP_FLOCK_LOCKS);
LL_SET_DEFAULT(se->op.readdirplus, FUSE_CAP_READDIRPLUS);
- LL_SET_DEFAULT(se->op.readdirplus, FUSE_CAP_READDIRPLUS_AUTO);
+ LL_SET_DEFAULT(se->op.readdirplus && se->op.readdir,
+ FUSE_CAP_READDIRPLUS_AUTO);
se->conn.time_gran = 1;
if (bufsize < FUSE_MIN_READ_BUFFER) {