summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/splice.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2020-01-07 23:52:59 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-07 23:54:14 -0800
commita53ac7307abfeb7172e67f48d0a7aaa4b5c3f31e (patch)
treeca5d790509a18bbdb9d76391478e5ac1d7f81239 /pkg/sentry/fs/splice.go
parente77ad574233b779519a253c6f58197c339e9100a (diff)
fs/splice: don't report a partialResult error if there is no data loss
PiperOrigin-RevId: 288642552
Diffstat (limited to 'pkg/sentry/fs/splice.go')
-rw-r--r--pkg/sentry/fs/splice.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/fs/splice.go b/pkg/sentry/fs/splice.go
index 311798811..389c330a0 100644
--- a/pkg/sentry/fs/splice.go
+++ b/pkg/sentry/fs/splice.go
@@ -167,6 +167,11 @@ func Splice(ctx context.Context, dst *File, src *File, opts SpliceOpts) (int64,
if !srcPipe && !opts.SrcOffset {
atomic.StoreInt64(&src.offset, src.offset+n)
}
+
+ // Don't report any errors if we have some progress without data loss.
+ if w.Err == nil {
+ err = nil
+ }
}
// Drop locks.