From 8c46fdab31b638ed676d38b27b6da6e4dcc8291e Mon Sep 17 00:00:00 2001 From: Darrel Herbst Date: Sun, 8 Oct 2017 10:27:27 -0400 Subject: [PATCH] swarm/fuse: Return amount of data written if the file exists 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 --- swarm/fuse/fuse_file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swarm/fuse/fuse_file.go b/swarm/fuse/fuse_file.go index 0cb59dfb38..32c85d02f7 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