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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
mount: check possible nil entry case
chrislua5c94acd4f5f
diff --git a/weed/mount/weedfs_attr.go b/weed/mount/weedfs_attr.goindex be504f5e20..41575a48fb 100644--- a/weed/mount/weedfs_attr.go+++ b/weed/mount/weedfs_attr.go@@ -48,7 +48,7 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fusedefer fh.entryLock.Unlock()}- if size, ok := input.GetSize(); ok {+ if size, ok := input.GetSize(); ok && entry != nil {glog.V(4).Infof("%v setattr set size=%v chunks=%d", path, size, len(entry.Chunks))if size < filer.FileSize(entry) {// fmt.Printf("truncate %v \n", fullPath)@@ -141,6 +141,9 @@ func (wfs *WFS) setAttrByPbEntry(out *fuse.Attr, inode uint64, entry *filer_pb.Eout.Size = filer.FileSize(entry)out.Blocks = (out.Size + blockSize - 1) / blockSizesetBlksize(out, blockSize)+ if entry == nil {+ return+ }out.Mtime = uint64(entry.Attributes.Mtime)out.Ctime = uint64(entry.Attributes.Mtime)out.Atime = uint64(entry.Attributes.Mtime)diff --git a/weed/mount/weedfs_xattr.go b/weed/mount/weedfs_xattr.goindex 64cc0f6f0e..fbfd6fca73 100644--- a/weed/mount/weedfs_xattr.go+++ b/weed/mount/weedfs_xattr.go@@ -106,6 +106,9 @@ func (wfs *WFS) SetXAttr(cancel <-chan struct{}, input *fuse.SetXAttrIn, attr stif status != fuse.OK {return status}+ if entry == nil {+ return fuse.ENOENT+ }if fh != nil {fh.entryLock.Lock()defer fh.entryLock.Unlock()@@ -181,6 +184,9 @@ func (wfs *WFS) RemoveXAttr(cancel <-chan struct{}, header *fuse.InHeader, attrif status != fuse.OK {return status}+ if entry == nil {+ return fuse.OK+ }if fh != nil {fh.entryLock.Lock()defer fh.entryLock.Unlock()