1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-05-09 21:09:59 +02:00

lock instead of RLock, to prevent racing condition

https://github.com/seaweedfs/seaweedfs/discussions/5432#discussioncomment-8933608
This commit is contained in:
chrislu 2024-03-27 16:05:11 -07:00
parent 36fec34c47
commit 6aa804b368

View file

@ -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