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: return IO error for mkdir
Chris Lu9d93c8365496
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.goindex f4132cbf0c..4687d5c916 100644--- a/weed/filesys/dir.go+++ b/weed/filesys/dir.go@@ -174,7 +174,7 @@ func (dir *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, errglog.V(1).Infof("mkdir: %v", request)if _, err := client.CreateEntry(ctx, request); err != nil {glog.V(0).Infof("mkdir %s/%s: %v", dir.Path, req.Name, err)- return fuse.EIO+ return err}return nil@@ -185,7 +185,7 @@ func (dir *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, errreturn node, nil}- return nil, err+ return nil, fuse.EIO}func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (node fs.Node, err error) {diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.goindex bee153cc56..9be290fe1e 100644--- a/weed/filesys/filehandle.go+++ b/weed/filesys/filehandle.go@@ -65,6 +65,7 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fusif err != nil {glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err)+ return fuse.EIO}return err@@ -103,11 +104,12 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f// write the request to volume serversfh.f.entry.Attributes.FileSize = uint64(max(req.Offset+int64(len(req.Data)), int64(fh.f.entry.Attributes.FileSize)))+ glog.V(0).Infof("%v write [%d,%d)", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data)))chunks, err := fh.dirtyPages.AddPage(ctx, req.Offset, req.Data)if err != nil {- glog.Errorf("%+v/%v write fh %d: [%d,%d): %v", fh.f.dir.Path, fh.f.Name, fh.handle, req.Offset, req.Offset+int64(len(req.Data)), err)- return fmt.Errorf("write %s/%s at [%d,%d): %v", fh.f.dir.Path, fh.f.Name, req.Offset, req.Offset+int64(len(req.Data)), err)+ glog.Errorf("%v write fh %d: [%d,%d): %v", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(len(req.Data)), err)+ return fuse.EIO}resp.Size = len(req.Data)@@ -155,7 +157,7 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error {chunks, err := fh.dirtyPages.FlushToStorage(ctx)if err != nil {glog.Errorf("flush %s/%s: %v", fh.f.dir.Path, fh.f.Name, err)- return fmt.Errorf("flush %s/%s: %v", fh.f.dir.Path, fh.f.Name, err)+ return fuse.EIO}fh.f.addChunks(chunks)@@ -209,5 +211,10 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error {fh.dirtyMetadata = false}- return err+ if err != nil {+ glog.Errorf("%v fh %d flush: %v", fh.f.fullpath(), fh.handle, err)+ return fuse.EIO+ }++ return nil}