diff options
Diffstat (limited to 'pkg/sentry/fs/gofer/session.go')
-rw-r--r-- | pkg/sentry/fs/gofer/session.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/pkg/sentry/fs/gofer/session.go b/pkg/sentry/fs/gofer/session.go index b5b1c8202..d626b86f5 100644 --- a/pkg/sentry/fs/gofer/session.go +++ b/pkg/sentry/fs/gofer/session.go @@ -197,17 +197,14 @@ func newInodeOperations(ctx context.Context, s *session, file contextFile, qid p } } - var hm *fsutil.HostMappable - if s.cachePolicy == cacheRemoteRevalidating && fs.IsFile(sattr) { - hm = fsutil.NewHostMappable() - } - fileState := &inodeFileState{ - s: s, - file: file, - sattr: sattr, - key: deviceKey, - hostMappable: hm, + s: s, + file: file, + sattr: sattr, + key: deviceKey, + } + if s.cachePolicy == cacheRemoteRevalidating && fs.IsFile(sattr) { + fileState.hostMappable = fsutil.NewHostMappable(fileState) } uattr := unstable(ctx, valid, attr, s.mounter, s.client) |