Skip to content

Commit 89860f4

Browse files
dherbstfjl
authored andcommitted
swarm/fuse: return amount of data written if the file exists (ethereum#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
1 parent 88b1db7 commit 89860f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

swarm/fuse/fuse_file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (sf *SwarmFile) Write(ctx context.Context, req *fuse.WriteRequest, resp *fu
134134
if err != nil {
135135
return err
136136
}
137-
resp.Size = int(sf.fileSize)
137+
resp.Size = len(req.Data)
138138
} else {
139139
log.Warn("Invalid write request size(%v) : off(%v)", sf.fileSize, req.Offset)
140140
return errInvalidOffset

0 commit comments

Comments
 (0)