From 34613778405fc9bd7bc4f95ba5c048a599555f2b Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Sun, 25 Sep 2016 19:29:26 +0100 Subject: 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. --- src/bindfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3