diff options
author | Jinmou Li <jinmli@google.com> | 2020-09-16 17:39:55 +0000 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-16 12:22:17 -0700 |
commit | 70cf503b4c3653df8253438a8873a5d3ebb688e3 (patch) | |
tree | 00d335e91489f54f473301bfaa8af17bda5f2869 /pkg/sentry | |
parent | 26879c32b8b48b6c066f1a5ba2c787e7061dabae (diff) |
fuse: fix FUSE_RELEASE reply handling
fix #3963
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/fsimpl/fuse/connection.go | 2 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/fuse/dev.go | 4 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/fuse/file.go | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/pkg/sentry/fsimpl/fuse/connection.go b/pkg/sentry/fsimpl/fuse/connection.go index a7402c149..dbc5e1954 100644 --- a/pkg/sentry/fsimpl/fuse/connection.go +++ b/pkg/sentry/fsimpl/fuse/connection.go @@ -110,7 +110,7 @@ type connection struct { // // We call the "background" requests in unix term as async requests. // The "async requests" in unix term is our async requests that expect a reply, - // i.e. `!requestOptions.noReply` + // i.e. `!request.noReply` // asyncMu protects the async request fields. asyncMu sync.Mutex diff --git a/pkg/sentry/fsimpl/fuse/dev.go b/pkg/sentry/fsimpl/fuse/dev.go index a19544fe9..5539466ff 100644 --- a/pkg/sentry/fsimpl/fuse/dev.go +++ b/pkg/sentry/fsimpl/fuse/dev.go @@ -309,10 +309,6 @@ func (fd *DeviceFD) writeLocked(ctx context.Context, src usermem.IOSequence, opt fut, ok := fd.completions[hdr.Unique] if !ok { - if fut.hdr.Unique == linux.FUSE_RELEASE { - // Currently we simply discard the reply for FUSE_RELEASE. - return n + src.NumBytes(), nil - } // Server sent us a response for a request we never sent, // or for which we already received a reply (e.g. aborted), an unlikely event. return 0, syserror.EINVAL diff --git a/pkg/sentry/fsimpl/fuse/file.go b/pkg/sentry/fsimpl/fuse/file.go index 991efcda4..83f2816b7 100644 --- a/pkg/sentry/fsimpl/fuse/file.go +++ b/pkg/sentry/fsimpl/fuse/file.go @@ -89,7 +89,7 @@ func (fd *fileDescription) Release(ctx context.Context) { // No way to invoke Call() with an errored request. return } - req.noReply = true + // The reply will be ignored since no callback is defined in asyncCallBack(). conn.CallAsync(kernelTask, req) } |