Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

lock instead of RLock, to prevent racing condition

chrislu6aa804b36824
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go
index 8c29ae0855..2c0b7203ed 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