aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzemul <zemul@foxmail.com>2023-04-24 13:34:38 +0800
committerGitHub <noreply@github.com>2023-04-23 22:34:38 -0700
commit68f1cc34a5878000a1ac8946a5722bd5f793b251 (patch)
treecda4689728068e8ef9353efd744e7fff71141c63
parente1b92bc701454285af15c7fb57a1645ba277e3c4 (diff)
downloadseaweedfs-68f1cc34a5878000a1ac8946a5722bd5f793b251.tar.xz
seaweedfs-68f1cc34a5878000a1ac8946a5722bd5f793b251.zip
[mount]Fix copy file range (#4407)
* fix:mount deadlock * fix --------- Co-authored-by: zemul <zhouzemiao@ihuman.com>
-rw-r--r--weed/mount/weedfs_file_copy_range.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/weed/mount/weedfs_file_copy_range.go b/weed/mount/weedfs_file_copy_range.go
index e3f841b02..49bab17f3 100644
--- a/weed/mount/weedfs_file_copy_range.go
+++ b/weed/mount/weedfs_file_copy_range.go
@@ -46,18 +46,14 @@ func (wfs *WFS) CopyFileRange(cancel <-chan struct{}, in *fuse.CopyFileRangeIn)
// lock source and target file handles
fhOut.Lock()
defer fhOut.Unlock()
- fhOut.entryLock.Lock()
- defer fhOut.entryLock.Unlock()
if fhOut.entry == nil {
return 0, fuse.ENOENT
}
if fhIn.fh != fhOut.fh {
- fhIn.Lock()
- defer fhIn.Unlock()
- fhIn.entryLock.Lock()
- defer fhIn.entryLock.Unlock()
+ fhIn.RLock()
+ defer fhIn.RUnlock()
}
// directories are not supported