Browse Source

return proper error

Chris Lu 4 years ago
parent
commit
cff8bb6554
2 changed files with 5 additions and 1 deletions
  1. 4 0
      weed/filer/reader_at.go
  2. 1 1
      weed/filesys/filehandle.go

+ 4 - 0
weed/filer/reader_at.go

@@ -58,6 +58,10 @@ func LookupFn(filerClient filer_pb.FilerClient) LookupFileIdFunctionType {
 			})
 		}
 
+		if err != nil {
+			return nil, err
+		}
+
 		for _, loc := range locations.Locations {
 			volumeServerAddress := filerClient.AdjustedUrl(loc.Url)
 			targetUrl := fmt.Sprintf("http://%s/%s", volumeServerAddress, fileId)

+ 1 - 1
weed/filesys/filehandle.go

@@ -79,7 +79,7 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus
 
 	if err != nil {
 		glog.Warningf("file handle read %s %d: %v", fh.f.fullpath(), totalRead, err)
-		return nil
+		return fuse.EIO
 	}
 
 	if totalRead > int64(len(buff)) {