aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/fuse
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 /swarm/fuse
parent88b1db728826efd499ea407579f41e8b683d6b53 (diff)
downloaddexon-89860f4197cb9bd2249c9ac4d854f3bc401a7926.tar.gz
dexon-89860f4197cb9bd2249c9ac4d854f3bc401a7926.tar.zst
dexon-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
Diffstat (limited to 'swarm/fuse')
-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