aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bindfs.c4
-rwxr-xr-xtests/test_bindfs.rb22
2 files changed, 15 insertions, 11 deletions
diff --git a/src/bindfs.c b/src/bindfs.c
index aae4281..a3691ac 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -933,7 +933,9 @@ static int bindfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
// errno in that case, so we zero it first and set it ourself if it
// doesn't.
#ifdef HAVE_FUSE_3
- if (filler(buf, de->d_name, &st, 0, ((flags & FUSE_READDIR_PLUS) ? 0 : FUSE_FILL_DIR_PLUS)) != 0) {
+ // TODO: FUSE_FILL_DIR_PLUS doesn't work with offset==0: https://github.com/libfuse/libfuse/issues/583
+ // Work around this by implementing the offset!=1 mode. Be careful - it's quite error-prone!
+ if (filler(buf, de->d_name, &st, 0, FUSE_FILL_DIR_PLUS) != 0) {
#else
if (filler(buf, de->d_name, &st, 0) != 0) {
#endif
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index 62f7bfd..69a5e70 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -462,18 +462,20 @@ testenv("", :title => "preserves inode numbers") do
assert { File.stat('mnt/dir').ino == File.stat('src/dir').ino }
end
-testenv("", :title => "preserves readdir inode numbers") do
- touch('src/file')
- mkdir('src/dir')
+unless $have_fuse_3 # TODO: re-enable after working around https://github.com/libfuse/libfuse/issues/583
+ testenv("", :title => "preserves readdir inode numbers") do
+ touch('src/file')
+ mkdir('src/dir')
+
+ inodes = {}
+ for line in `#{$tests_dir}/readdir_inode mnt`.split("\n").reject(&:empty?)
+ inode, name = line.split(" ")
+ inodes[name] = inode.to_i
+ end
- inodes = {}
- for line in `#{$tests_dir}/readdir_inode mnt`.split("\n").reject(&:empty?)
- inode, name = line.split(" ")
- inodes[name] = inode.to_i
+ assert { inodes['file'] == File.stat('src/file').ino }
+ assert { inodes['dir'] == File.stat('src/dir').ino }
end
-
- assert { inodes['file'] == File.stat('src/file').ino }
- assert { inodes['dir'] == File.stat('src/dir').ino }
end
root_testenv("", :title => "setgid directories") do