aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-08-16 23:49:10 -0700
committerChris Lu <chris.lu@gmail.com>2020-08-16 23:49:10 -0700
commitf5837b700079b8ad5cf52a7a4996ab49a57b4289 (patch)
treeaa419c9d053fe3f25df4d6e1b1d97b1ceb7ab9c7
parent2ac27616bcc9f37adb22ccd00662584724d47a6d (diff)
downloadseaweedfs-f5837b700079b8ad5cf52a7a4996ab49a57b4289.tar.xz
seaweedfs-f5837b700079b8ad5cf52a7a4996ab49a57b4289.zip
report error first
-rw-r--r--weed/filesys/filehandle.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index b0242fb19..a40135b42 100644
--- a/weed/filesys/filehandle.go
+++ b/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 = min(int64(len(buff)), totalRead)
- resp.Data = buff[:totalRead]
-
if err != nil {
glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err)
return fuse.EIO
}
+ totalRead = min(int64(len(buff)), totalRead)
+ resp.Data = buff[:totalRead]
+
return err
}