From 6147b61b0a2ec576ade74c365884ac3bb51c56b6 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 21 Jul 2022 01:38:26 -0700 Subject: [PATCH] mount: fix concurrent map read and map write fix https://github.com/chrislusf/seaweedfs/issues/3344 --- weed/mount/weedfs_rename.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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