diff options
author | Boyuan He <heboyuan@google.com> | 2020-08-18 20:59:28 +0000 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-16 12:19:30 -0700 |
commit | 947088e10a15b5236f2af3206f67f27245ef2770 (patch) | |
tree | 3d9920547a1e8e3295ef68857fd096cb85ae7629 /pkg/sentry/fsimpl/fuse/dev.go | |
parent | 32044f94e9dfbb88c17d07b235b8ed5b07d2ff18 (diff) |
Implement FUSE_RELEASE/RELEASEDIR
Fixes #3314
Diffstat (limited to 'pkg/sentry/fsimpl/fuse/dev.go')
-rw-r--r-- | pkg/sentry/fsimpl/fuse/dev.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/fuse/dev.go b/pkg/sentry/fsimpl/fuse/dev.go index 0efd2d90d..e2de8e097 100644 --- a/pkg/sentry/fsimpl/fuse/dev.go +++ b/pkg/sentry/fsimpl/fuse/dev.go @@ -168,6 +168,9 @@ func (fd *DeviceFD) readLocked(ctx context.Context, dst usermem.IOSequence, opts // We're done with this request. fd.queue.Remove(req) + if req.hdr.Opcode == linux.FUSE_RELEASE { + fd.numActiveRequests -= 1 + } // Restart the read as this request was invalid. log.Warningf("fuse.DeviceFD.Read: request found was too large. Restarting read.") @@ -184,6 +187,9 @@ func (fd *DeviceFD) readLocked(ctx context.Context, dst usermem.IOSequence, opts if readCursor >= req.hdr.Len { // Fully done with this req, remove it from the queue. fd.queue.Remove(req) + if req.hdr.Opcode == linux.FUSE_RELEASE { + fd.numActiveRequests -= 1 + } break } } |