summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/fuse/regular_file.go
diff options
context:
space:
mode:
authorCraig Chi <craigchi@google.com>2020-09-09 09:16:09 -0700
committerAndrei Vagin <avagin@gmail.com>2020-09-11 13:35:25 -0700
commitcc9dff706be5518466ac677c19fc9436e059855d (patch)
treef575f9ed50eb5a49c6a53d86a267b317fb64fbd9 /pkg/sentry/fsimpl/fuse/regular_file.go
parent88820940a980081711ce848592609dd4192e1be5 (diff)
Add fh support for revise attr and fstat(2) test
According to Linux 4.4's FUSE behavior, the flags and fh attributes in FUSE_GETATTR are only used in read, write, and lseek. fstat(2) doesn't use them either. Add tests to ensure the requests sent from FUSE module are consistent with Linux's. Updates #3655
Diffstat (limited to 'pkg/sentry/fsimpl/fuse/regular_file.go')
-rw-r--r--pkg/sentry/fsimpl/fuse/regular_file.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/fuse/regular_file.go b/pkg/sentry/fsimpl/fuse/regular_file.go
index 193e77392..5bdd096c3 100644
--- a/pkg/sentry/fsimpl/fuse/regular_file.go
+++ b/pkg/sentry/fsimpl/fuse/regular_file.go
@@ -65,7 +65,7 @@ func (fd *regularFileFD) PRead(ctx context.Context, dst usermem.IOSequence, offs
// Reading beyond EOF, update file size if outdated.
if uint64(offset+size) > atomic.LoadUint64(&inode.size) {
- if err := inode.reviseAttr(ctx); err != nil {
+ if err := inode.reviseAttr(ctx, linux.FUSE_GETATTR_FH, fd.Fh); err != nil {
return 0, err
}
// If the offset after update is still too large, return error.