diff options
author | Craig Chi <craigchi@google.com> | 2020-08-19 22:12:15 -0700 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-11 13:35:25 -0700 |
commit | 3c7692e8c5bd21432e8ecab9556722d00f54384a (patch) | |
tree | d873e84bb71332a468abadd4f75ff056f63d56e3 | |
parent | 0f2a8b08f13cc39d924c328bc7a9bab73c1c2328 (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.go | 2 |
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), |