From 6aa804b368242f853b5258f20178eae8a5eda26f Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 27 Mar 2024 16:05:11 -0700 Subject: [PATCH] lock instead of RLock, to prevent racing condition https://github.com/seaweedfs/seaweedfs/discussions/5432#discussioncomment-8933608 --- weed/mount/inode_to_path.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go index 8c29ae085..2c0b7203e 100644 --- a/weed/mount/inode_to_path.go +++ b/weed/mount/inode_to_path.go @@ -146,8 +146,8 @@ func (i *InodeToPath) HasPath(path util.FullPath) bool { } func (i *InodeToPath) MarkChildrenCached(fullpath util.FullPath) { - i.RLock() - defer i.RUnlock() + i.Lock() + defer i.Unlock() inode, found := i.path2inode[fullpath] if !found { // https://github.com/seaweedfs/seaweedfs/issues/4968