fuse-ext2
fuse-ext2 copied to clipboard
Broken readdir() implementation
Description
readdir()
appears to be missing some entries when mounting ext4 filesystem (from Android factory images if that matters). It appears that problematic behavior is consistent across different runs of the same image file (same files are missing).
To be honest I don't have the time at the moment to get to the bottom of it, so not sure which component introduces the bug (might be a combination with e2fsprogs deps). You can find some additional info around the case that surfaced the bug here.
Temp workaround
Change default to walk_dir()
/ ext2fs_dir_iterate()
.
$ git diff
diff --git a/fuse-ext2/op_readdir.c b/fuse-ext2/op_readdir.c
index 60e1890..203d60f 100644
--- a/fuse-ext2/op_readdir.c
+++ b/fuse-ext2/op_readdir.c
@@ -25,7 +25,7 @@ struct dir_walk_data {
fuse_fill_dir_t filler;
};
-#define _USE_DIR_ITERATE2 1
+//#define _USE_DIR_ITERATE2 1
#if defined(_USE_DIR_ITERATE2) && (_USE_DIR_ITERATE2 == 1)
static int walk_dir2 (ext2_ino_t dir, int entry, struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, void *vpsid)
{
System info
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.2
BuildVersion: 16C67
$ xcode-select -v
xcode-select version 2347.
$ cat /Library/Filesystems/osxfuse.fs/Contents/version.plist | grep 'CFBundleVersion' -A1
<key>CFBundleVersion</key>
<string>3.5.4</string>
$ cat e2fsprogs-1.43.3/version.h | grep E2FSPROGS_VERSION
#define E2FSPROGS_VERSION "1.43.3"
i will check dir_iterate as soon as possible, for now dir_iterete_2 is disabled 48cc22e05768514d2617f8e52de331426882a2e7