-
Notifications
You must be signed in to change notification settings - Fork 1.2k
readdir returns d_ino==-1 in offset==0 mode #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report! Looks this check has been there ever since the first introduction of readdirplus support in 2014. Looking at the code, I am not sure why there is a condition on |
The first if-else in |
Makes sense - pull requests welcome :-). This would be a great opportunity to add a unit test for this mode of operation, so that it doesn't break again in the future. |
- Test added for all passthrough examples. - passthrough.c uses offset==0 mode. The others don't. - passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass. - This fixes #583.
I seem to have fallen in the same trap under the same conditions. Moreover, the st_ino is not taken from the "struct stat" provided by the filler when use_ino is set, resulting of d_ino returned as -1. The patch below fixes that, but the conditions might not be correct, maybe st_mode should be filled unconditionally. --- a/lib/fuse.c 2021-03-02 21:40:51.112958271 +0100
|
The same patch again with proper fencing. Sorry about it.
|
…e#584) - Test added for all passthrough examples. - passthrough.c uses offset==0 mode. The others don't. - passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass. - This fixes libfuse#583.
…e#584) - Test added for all passthrough examples. - passthrough.c uses offset==0 mode. The others don't. - passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass. - This fixes libfuse#583. (cherry picked from commit 5012a05)
…e#584) - Test added for all passthrough examples. - passthrough.c uses offset==0 mode. The others don't. - passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass. - This fixes libfuse#583. (cherry picked from commit 5012a05)
…e#584) - Test added for all passthrough examples. - passthrough.c uses offset==0 mode. The others don't. - passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass. - This fixes libfuse#583. (cherry picked from commit 5012a05)
…e#584) - Test added for all passthrough examples. - passthrough.c uses offset==0 mode. The others don't. - passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass. - This fixes libfuse#583. (cherry picked from commit 5012a05)
(Background: @McBane87 and I are trying to upgrade bindfs to FUSE 3.)
Always passing 0 as the offset to the readdir filler function ("mode 1" in
fuse.h
) causes clients to always seed_ino == -1
when they readdir (test program).passthrough
example exhibits this problem, butpassthrough_fh
andpassthrough_ll
don't.use_ino
is set.FUSE_FILL_DIR_PLUS
is passed.Possible fix
On this line, remove
off &&
.Then
passthrough
passes through inode numbers if I just change it to (always) passFUSE_FILL_DIR_PLUS
.I don't know the code well enough to tell whether that change is safe. It doesn't break any tests at least.
The text was updated successfully, but these errors were encountered: