aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_rename.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-21 01:38:26 -0700
committerchrislu <chris.lu@gmail.com>2022-07-21 01:38:26 -0700
commit6147b61b0a2ec576ade74c365884ac3bb51c56b6 (patch)
treeeeb46eb4e332ade3fd553ba0f29ad72209c2640c /weed/mount/weedfs_rename.go
parent9ec0d1caaa1d7e7c9d19951aa0689eb47da8b8fa (diff)
downloadseaweedfs-6147b61b0a2ec576ade74c365884ac3bb51c56b6.tar.xz
seaweedfs-6147b61b0a2ec576ade74c365884ac3bb51c56b6.zip
mount: fix concurrent map read and map write
fix https://github.com/chrislusf/seaweedfs/issues/3344
Diffstat (limited to 'weed/mount/weedfs_rename.go')
-rw-r--r--weed/mount/weedfs_rename.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/mount/weedfs_rename.go b/weed/mount/weedfs_rename.go
index 0c7de0bbb..538cfead7 100644
--- a/weed/mount/weedfs_rename.go
+++ b/weed/mount/weedfs_rename.go
@@ -235,7 +235,7 @@ func (wfs *WFS) handleRenameResponse(ctx context.Context, resp *filer_pb.StreamR
sourceInode, targetInode := wfs.inodeToPath.MovePath(oldPath, newPath)
if sourceInode != 0 {
- if fh, foundFh := wfs.fhmap.inode2fh[sourceInode]; foundFh && fh.entry != nil {
+ if fh, foundFh := wfs.fhmap.FindFileHandle(sourceInode); foundFh && fh.entry != nil {
fh.entry.Name = newName
}
// invalidate attr and data