diff options
-rw-r--r-- | pkg/sentry/fsimpl/gofer/handle.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/gofer/handle.go b/pkg/sentry/fsimpl/gofer/handle.go index 0bc201d1c..5c57f6fea 100644 --- a/pkg/sentry/fsimpl/gofer/handle.go +++ b/pkg/sentry/fsimpl/gofer/handle.go @@ -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 } |