aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_file_copy_range.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2022-12-05 12:32:27 -0800
committerGitHub <noreply@github.com>2022-12-05 12:32:27 -0800
commitdac9c28d05cd61402cf5fbac42507b49b5a4f7a5 (patch)
treea0ca34e1f223df0b7ace31bd3a1155389611301c /weed/mount/weedfs_file_copy_range.go
parent38479b6329ead2d2e35850bd894bf9d8e030f09f (diff)
downloadseaweedfs-dac9c28d05cd61402cf5fbac42507b49b5a4f7a5.tar.xz
seaweedfs-dac9c28d05cd61402cf5fbac42507b49b5a4f7a5.zip
Revert "refactor: moved to locked entry" (#4035)
* Revert "refactor: moved to locked entry" This reverts commit 94bc9afd9d3f8e049219c1cdc9f0d6e0eb4cf456. * only add LockedEntry, no changes to entryLock * fix compilation
Diffstat (limited to 'weed/mount/weedfs_file_copy_range.go')
-rw-r--r--weed/mount/weedfs_file_copy_range.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/mount/weedfs_file_copy_range.go b/weed/mount/weedfs_file_copy_range.go
index 4b0d22137..bc092a252 100644
--- a/weed/mount/weedfs_file_copy_range.go
+++ b/weed/mount/weedfs_file_copy_range.go
@@ -46,6 +46,8 @@ func (wfs *WFS) CopyFileRange(cancel <-chan struct{}, in *fuse.CopyFileRangeIn)
// lock source and target file handles
fhOut.orderedMutex.Acquire(context.Background(), 1)
defer fhOut.orderedMutex.Release(1)
+ fhOut.entryLock.Lock()
+ defer fhOut.entryLock.Unlock()
if fhOut.entry == nil {
return 0, fuse.ENOENT
@@ -54,6 +56,8 @@ func (wfs *WFS) CopyFileRange(cancel <-chan struct{}, in *fuse.CopyFileRangeIn)
if fhIn.fh != fhOut.fh {
fhIn.orderedMutex.Acquire(context.Background(), 1)
defer fhIn.orderedMutex.Release(1)
+ fhIn.entryLock.Lock()
+ defer fhIn.entryLock.Unlock()
}
// directories are not supported