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.

mount: apply UID/GID mapping in lookupEntry for cache misses (#8144)

Chris Lu8e9c12e2c718
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go
index 1234fa005b..14a135e049 100644
--- a/weed/mount/weedfs.go
+++ b/weed/mount/weedfs.go
@@ -306,6 +306,9 @@ func (wfs *WFS) lookupEntry(fullpath util.FullPath) (*filer.Entry, fuse.Status)
glog.V(1).Infof("lookupEntry GetEntry %s: %v", fullpath, err)
return nil, fuse.ENOENT
}
+ if entry != nil && entry.Attributes != nil && wfs.option.UidGidMapper != nil {
+ entry.Attributes.Uid, entry.Attributes.Gid = wfs.option.UidGidMapper.FilerToLocal(entry.Attributes.Uid, entry.Attributes.Gid)
+ }
return filer.FromPbEntry(dir, entry), fuse.OK
}