Skip to content

Commit

Permalink
swarm/fuse: return amount of data written if the file exists (ethereu…
Browse files Browse the repository at this point in the history
…m#15261)

If the file already existed, the WriteResponse.Size was being set
as the length of the entire file, not just the amount that was
written to the existing file.

Fixes ethereum#15216
  • Loading branch information
dherbst authored and fjl committed Oct 9, 2017
1 parent 88b1db7 commit 89860f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swarm/fuse/fuse_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (sf *SwarmFile) Write(ctx context.Context, req *fuse.WriteRequest, resp *fu
if err != nil {
return err
}
resp.Size = int(sf.fileSize)
resp.Size = len(req.Data)
} else {
log.Warn("Invalid write request size(%v) : off(%v)", sf.fileSize, req.Offset)
return errInvalidOffset
Expand Down

0 comments on commit 89860f4

Please sign in to comment.