Browse Source

report error first

pull/1427/head
Chris Lu 5 years ago
parent
commit
f5837b7000
  1. 6
      weed/filesys/filehandle.go

6
weed/filesys/filehandle.go

@ -68,14 +68,14 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus
totalRead = max(maxStop - req.Offset, totalRead) totalRead = max(maxStop - req.Offset, totalRead)
} }
totalRead = min(int64(len(buff)), totalRead)
resp.Data = buff[:totalRead]
if err != nil { if err != nil {
glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err) glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err)
return fuse.EIO return fuse.EIO
} }
totalRead = min(int64(len(buff)), totalRead)
resp.Data = buff[:totalRead]
return err return err
} }

Loading…
Cancel
Save