Skip to content
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

fuse3 wrongly assumes sequential directory offsets in handle_readdir #12

Closed
asomers opened this issue Sep 5, 2021 · 0 comments · Fixed by #17
Closed

fuse3 wrongly assumes sequential directory offsets in handle_readdir #12

asomers opened this issue Sep 5, 2021 · 0 comments · Fixed by #17

Comments

@asomers
Copy link
Contributor

asomers commented Sep 5, 2021

The FUSE protocol allows each directory entry to include a off field in struct fuse_dirent. It's purpose is to uniquely identify a directory entry so that a future FUSE_READDIR operation may continue where a previous one left off. The FUSE file system is allowed to choose the format of those off values. In particular, sequentially increasing indexes are usually not adequate, because if a directory entry is deleted in between two FUSE_READDIR operations, using sequential off values could lead to skipping over a directory entry.
fuse3 currently manages the off value itself, in handle_readdir, and provides the file system with no means to override it. Instead, the off value should be specified by the file system as part of reply::DirectoryEntry.

asomers added a commit to asomers/fuse3 that referenced this issue Sep 22, 2021
The FUSE protocol allows each directory entry to include a off field in
struct fuse_dirent. It's purpose is to uniquely identify a directory
entry so that a future FUSE_READDIR operation may continue where a
previous one left off. The FUSE file system is allowed to choose the
format of those off values. In particular, sequentially increasing
indexes are usually not adequate, because if a directory entry is
deleted in between two FUSE_READDIR operations, using sequential off
values could lead to skipping over a directory entry.

Instead of attempting to manage those offsets with fuse3, forcing them
to be sequential, pass responsibility to the file system.

Fixes Sherlock-Holo#12
asomers added a commit to asomers/fuse3 that referenced this issue Sep 22, 2021
The FUSE protocol allows each directory entry to include a off field in
struct fuse_dirent. It's purpose is to uniquely identify a directory
entry so that a future FUSE_READDIR operation may continue where a
previous one left off. The FUSE file system is allowed to choose the
format of those off values. In particular, sequentially increasing
indexes are usually not adequate, because if a directory entry is
deleted in between two FUSE_READDIR operations, using sequential off
values could lead to skipping over a directory entry.

Instead of attempting to manage those offsets with fuse3, forcing them
to be sequential, pass responsibility to the file system.

Fixes Sherlock-Holo#12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant