diff options
author | Craig Chi <craigchi@google.com> | 2020-08-19 22:12:15 -0700 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-16 12:19:30 -0700 |
commit | 21cac9dd042f3446258387378a743b8a7cd76443 (patch) | |
tree | 051981ea61b01d026358749760b23eeef55b1474 /pkg/sentry/fsimpl | |
parent | d51ddcefdc46a1007f7345bfa2f7006bb820b157 (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
Diffstat (limited to 'pkg/sentry/fsimpl')
-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), |