aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrel Herbst <dherbst@gmail.com>2017-10-09 18:45:30 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-10-09 18:45:30 +0800
commit89860f4197cb9bd2249c9ac4d854f3bc401a7926 (patch)
tree160e5c64e1531d19c46cadf5da31d49ce1c5b72d
parent88b1db728826efd499ea407579f41e8b683d6b53 (diff)
downloadgo-tangerine-89860f4197cb9bd2249c9ac4d854f3bc401a7926.tar
go-tangerine-89860f4197cb9bd2249c9ac4d854f3bc401a7926.tar.gz
go-tangerine-89860f4197cb9bd2249c9ac4d854f3bc401a7926.tar.bz2
go-tangerine-89860f4197cb9bd2249c9ac4d854f3bc401a7926.tar.lz
go-tangerine-89860f4197cb9bd2249c9ac4d854f3bc401a7926.tar.xz
go-tangerine-89860f4197cb9bd2249c9ac4d854f3bc401a7926.tar.zst
go-tangerine-89860f4197cb9bd2249c9ac4d854f3bc401a7926.zip
swarm/fuse: return amount of data written if the file exists (#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 #15216
-rw-r--r--swarm/fuse/fuse_file.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/swarm/fuse/fuse_file.go b/swarm/fuse/fuse_file.go
index 0cb59dfb3..32c85d02f 100644
--- a/swarm/fuse/fuse_file.go
+++ b/swarm/fuse/fuse_file.go
@@ -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