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.
Showing the changes to cmd/mount (1 of 2 files). Show all
Unified · Split
| @@ -80,5 +80,9 @@ var _ fusefs.HandleReleaser = (*FileHandle)(nil) · 79 unmodified lines | |||
| 80 | // the kernel | 80 | // the kernel |
| 81 | func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) (err error) { | 81 | func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) (err error) { |
| 82 | defer log.Trace(fh, "")("err=%v", &err) | 82 | 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 | ||
| 84 | } | 88 | } |