From 70cf503b4c3653df8253438a8873a5d3ebb688e3 Mon Sep 17 00:00:00 2001 From: Jinmou Li Date: Wed, 16 Sep 2020 17:39:55 +0000 Subject: fuse: fix FUSE_RELEASE reply handling fix #3963 --- pkg/sentry/fsimpl/fuse/connection.go | 2 +- pkg/sentry/fsimpl/fuse/dev.go | 4 ---- pkg/sentry/fsimpl/fuse/file.go | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) (limited to 'pkg/sentry/fsimpl') 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) } -- cgit v1.2.3