diff options
| author | chrislu <chris.lu@gmail.com> | 2024-03-27 16:05:11 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-03-27 16:05:11 -0700 |
| commit | 6aa804b368242f853b5258f20178eae8a5eda26f (patch) | |
| tree | 2d1821b0127db333e77ac1a192444632a12408e6 /weed/mount/inode_to_path.go | |
| parent | 36fec34c472266fe2a8f087af7de3945dc198726 (diff) | |
| download | seaweedfs-6aa804b368242f853b5258f20178eae8a5eda26f.tar.xz seaweedfs-6aa804b368242f853b5258f20178eae8a5eda26f.zip | |
lock instead of RLock, to prevent racing condition
https://github.com/seaweedfs/seaweedfs/discussions/5432#discussioncomment-8933608
Diffstat (limited to 'weed/mount/inode_to_path.go')
| -rw-r--r-- | weed/mount/inode_to_path.go | 4 |
1 files 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 |
