History

mount,cmount: run Release asynchronously

Before this change the mount and cmount would run Release synchronously. This would mean that it would wait for files to be closed (eg uploaded) before returning to the kernel. However Release is already running asynchronously from userspace so this commit changes it to do the functionality of Release asynchronously too. This should fix libfuse blocking when Release is active and it is asked to do something else with a file.

Nick Craig-Wood committed 7 years ago

Commit 8fd25771 parent f8652802 files · +10 −2Browse files

Showing the changes to cmd/mount (1 of 2 files). Show all

Unified · Split

cmd/mount/handle.go+5−1
@@ -80,5 +80,9 @@ var _ fusefs.HandleReleaser = (*FileHandle)(nil) · 79 unmodified lines
8080 // the kernel
8181 func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) (err error) {
8282 defer log.Trace(fh, "")("err=%v", &err)
83− return translateError(fh.Handle.Release())
83+ // Run the Release asynchronously, ignoring errors
84+ go func() {
85+ _ = fh.Handle.Release()
86+ }()
87+ return nil
8488 }