mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
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
This commit is contained in:
parent
7a045af05b
commit
8c46fdab31
1 changed files with 1 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ func (sf *SwarmFile) Write(ctx context.Context, req *fuse.WriteRequest, resp *fu
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
resp.Size = int(sf.fileSize)
|
resp.Size = len(req.Data)
|
||||||
} else {
|
} else {
|
||||||
log.Warn("Invalid write request size(%v) : off(%v)", sf.fileSize, req.Offset)
|
log.Warn("Invalid write request size(%v) : off(%v)", sf.fileSize, req.Offset)
|
||||||
return errInvalidOffset
|
return errInvalidOffset
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue