Commit da47c218 authored by Jeromy's avatar Jeromy

take offset into account for computing read size

parent 4e7140dd
......@@ -170,7 +170,7 @@ func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR
return err
}
buf := resp.Data[:min(req.Size, int(r.Size()))]
buf := resp.Data[:min(req.Size, int(r.Size()-req.Offset))]
n, err := io.ReadFull(r, buf)
if err != nil && err != io.EOF {
return err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment