mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
[op] Make gofer client handle return partial write length when err is nil.
If there was a partial write (when not using the host FD) which did not generate an error, we were incorrectly returning the number of bytes attempted to write instead of the number of bytes actually written. PiperOrigin-RevId: 363058989
This commit is contained in:
@@ -124,8 +124,9 @@ func (h *handle) writeFromBlocksAt(ctx context.Context, srcs safemem.BlockSeq, o
|
||||
return 0, cperr
|
||||
}
|
||||
n, err := h.file.writeAt(ctx, buf[:cp], offset)
|
||||
// err takes precedence over cperr.
|
||||
if err != nil {
|
||||
return uint64(n), err
|
||||
}
|
||||
return cp, cperr
|
||||
return uint64(n), cperr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user