mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
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. Forum: https://forum.rclone.org/t/vfs-cache-mode-writes-upload-expected-behaviour/8014
This commit is contained in:
parent
f865280afa
commit
8fd2577694
|
@ -388,7 +388,11 @@ func (fsys *FS) Release(path string, fh uint64) (errc int) {
|
|||
return errc
|
||||
}
|
||||
_ = fsys.closeHandle(fh)
|
||||
return translateError(handle.Release())
|
||||
// Run the Release asynchronously, ignoring errors
|
||||
go func() {
|
||||
_ = handle.Release()
|
||||
}()
|
||||
return 0
|
||||
}
|
||||
|
||||
// Unlink removes a file.
|
||||
|
|
|
@ -80,5 +80,9 @@ var _ fusefs.HandleReleaser = (*FileHandle)(nil)
|
|||
// the kernel
|
||||
func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) (err error) {
|
||||
defer log.Trace(fh, "")("err=%v", &err)
|
||||
return translateError(fh.Handle.Release())
|
||||
// Run the Release asynchronously, ignoring errors
|
||||
go func() {
|
||||
_ = fh.Handle.Release()
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user