aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2016-09-25 19:29:26 +0100
committerMartin Pärtel <martin.partel@gmail.com>2016-09-25 19:29:26 +0100
commit34613778405fc9bd7bc4f95ba5c048a599555f2b (patch)
tree4ad627125671d445c4675bf59aebbe75974420e6
parent333d463397a4a482f2438dc2ae19cef5ab606215 (diff)
downloadbindfs-34613778405fc9bd7bc4f95ba5c048a599555f2b.tar.gz
Remove seekdir() call from bindfs_readdir().
A regression was introduced in bindfs 1.13.1 with the fix (or rather, workaround) for #28. FUSE's contract for readdir says that if `filler` is passed a zero offset then the readdir implementation should ignore the offset parameter, but we didn't. Fixes #39.
-rw-r--r--ChangeLog5
-rw-r--r--src/bindfs.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 31ca9bf..c1296bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-25 Martin Pärtel <martin dot partel at gmail dot com>
+
+ * Fix bug in readdir() introduced with 1.13.1. This fixes a bug when
+ a bindfs mount is exported over NFS (issue #39).
+
2016-07-31 Martin Pärtel <martin dot partel at gmail dot com>
* Added --enable-ioctl to address issue #37.
diff --git a/src/bindfs.c b/src/bindfs.c
index 82cbe0d..004c771 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -673,7 +673,6 @@ static int bindfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
}
de_buf = malloc(offsetof(struct dirent, d_name) + pc_ret + 1);
- seekdir(dp, offset);
while (1) {
result = readdir_r(dp, de_buf, &de);
if (result != 0) {
@@ -688,7 +687,9 @@ static int bindfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
st.st_ino = de->d_ino;
st.st_mode = de->d_type << 12;
- // See issue #28 for why we pass a 0 offset to `filler`.
+ // See issue #28 for why we pass a 0 offset to `filler` and ignore
+ // `offset`.
+ //
// Given a 0 offset, `filler` should never return non-zero, so we
// consider it an error if it does. It is undocumented whether it sets
// errno in that case, so we zero it first and set it ourself if it