From 21cac9dd042f3446258387378a743b8a7cd76443 Mon Sep 17 00:00:00 2001 From: Craig Chi Date: Wed, 19 Aug 2020 22:12:15 -0700 Subject: 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 --- pkg/sentry/fsimpl/fuse/directory.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/sentry') 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), -- cgit v1.2.3