mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
report error first
This commit is contained in:
parent
2ac27616bc
commit
f5837b7000
|
@ -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…
Reference in a new issue