summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCraig Chi <craigchi@google.com>2020-08-19 22:12:15 -0700
committerAndrei Vagin <avagin@gmail.com>2020-09-11 13:35:25 -0700
commit3c7692e8c5bd21432e8ecab9556722d00f54384a (patch)
treed873e84bb71332a468abadd4f75ff056f63d56e3
parent0f2a8b08f13cc39d924c328bc7a9bab73c1c2328 (diff)
Fix FUSE_READDIR offset issue
According to readdir(3), the offset attribute in struct dirent is the offset to the next dirent instead of the offset of itself. Send the successive FUSE_READDIR requests with the offset retrieved from the last entry. Updates #3255
-rw-r--r--pkg/sentry/fsimpl/fuse/directory.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/fuse/directory.go b/pkg/sentry/fsimpl/fuse/directory.go
index 8c59680e8..a83357129 100644
--- a/pkg/sentry/fsimpl/fuse/directory.go
+++ b/pkg/sentry/fsimpl/fuse/directory.go
@@ -87,7 +87,7 @@ func (dir *directoryFD) IterDirents(ctx context.Context, callback vfs.IterDirent
}
for _, fuseDirent := range out.Dirents {
- nextOff := int64(fuseDirent.Meta.Off) + 1
+ nextOff := int64(fuseDirent.Meta.Off)
dirent := vfs.Dirent{
Name: fuseDirent.Name,
Type: uint8(fuseDirent.Meta.Type),