Skip to content

fuse: Ensure readdir returns same ino as lookup#140

Merged
bergwolf merged 1 commit intocloud-hypervisor:masterfrom
Champ-Goblem:readdir-incorrect-inode-number
Jul 7, 2023
Merged

fuse: Ensure readdir returns same ino as lookup#140
bergwolf merged 1 commit intocloud-hypervisor:masterfrom
Champ-Goblem:readdir-incorrect-inode-number

Conversation

@Champ-Goblem
Copy link
Contributor

The filesystem test utility xfs-tests[1] failed on test generic/637 with the error entry 8 has inode 72057594038044051, expected 112052. The expected inode returned from readdir is neither converted nor the same inode as assigned by do_lookup, as stated in the docs for DirEntry.ino.

Update readdir to perform do_lookup to get the correct inode number and then convert this inode number to the expected format.

After this change the test generic/637 passes and no regressions in other tests.

[1] https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/

The filesystem test utility xfs-tests[1] failed on test generic/637 with
the error entry 8 has inode 72057594038044051, expected 112052
The expected inode returned from readdir is neither converted nor
the same inode as assigned by do_lookup, as stated in the docs
for DirEntry.ino.

Update readdir to perform do_lookup to get the correct inode number
and then convert this inode number to the expected format.

After this change the test generic/637 passes and no regressions in
other tests.

[1] https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/

Signed-off-by: Champ-Goblem <cameron@northflank.com>
@Champ-Goblem
Copy link
Contributor Author

Thinking about it the do_lookup may even need to be moved to https://github.com/cloud-hypervisor/fuse-backend-rs/pull/140/files#diff-af0f3cc16786ebade0e05df8f51a96c30604e6673aa8f4d2f02aa71d73667352L547

and then restore the old Self::stat code so that pseudo fs has the correct ino?

Copy link
Contributor

@bergwolf bergwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks! Let's just add do_lookup in passthroughfs as backendfs is supposed to return its own inode number in fs.readdir and it is just passthroufs's requirement to allocate the inode number through do_lookup.

@bergwolf bergwolf merged commit f4293a9 into cloud-hypervisor:master Jul 7, 2023
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 this pull request may close these issues.

2 participants