summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-01-28 21:49:38 +0000
committergVisor bot <gvisor-bot@google.com>2020-01-28 21:49:38 +0000
commit0e3ddb2aa6f7cd971510dcdd09ae4d3dc8d849cf (patch)
tree96c40241f85f393dfb18b8d13ffaa61bb8419c00 /pkg/sentry/fs
parent0ba30993d9369b19149cc236616a9e558820f61a (diff)
parentf263801a74d4ccac042b068d0928c8738e40af5b (diff)
Merge release-20200115.0-122-gf263801 (automated)
Diffstat (limited to 'pkg/sentry/fs')
-rw-r--r--pkg/sentry/fs/attr.go5
-rw-r--r--pkg/sentry/fs/file.go7
-rw-r--r--pkg/sentry/fs/splice.go5
3 files changed, 5 insertions, 12 deletions
diff --git a/pkg/sentry/fs/attr.go b/pkg/sentry/fs/attr.go
index fa9e7d517..f60bd423d 100644
--- a/pkg/sentry/fs/attr.go
+++ b/pkg/sentry/fs/attr.go
@@ -206,6 +206,11 @@ func IsPipe(s StableAttr) bool {
return s.Type == Pipe
}
+// IsAnonymous returns true if StableAttr.Type matches any type of anonymous.
+func IsAnonymous(s StableAttr) bool {
+ return s.Type == Anonymous
+}
+
// IsSocket returns true if StableAttr.Type matches any type of socket.
func IsSocket(s StableAttr) bool {
return s.Type == Socket
diff --git a/pkg/sentry/fs/file.go b/pkg/sentry/fs/file.go
index ca3466f4f..78100e448 100644
--- a/pkg/sentry/fs/file.go
+++ b/pkg/sentry/fs/file.go
@@ -555,10 +555,6 @@ type lockedWriter struct {
//
// This applies only to Write, not WriteAt.
Offset int64
-
- // Err contains the first error encountered while copying. This is
- // useful to determine whether Writer or Reader failed during io.Copy.
- Err error
}
// Write implements io.Writer.Write.
@@ -594,8 +590,5 @@ func (w *lockedWriter) WriteAt(buf []byte, offset int64) (int, error) {
break
}
}
- if w.Err == nil {
- w.Err = err
- }
return written, err
}
diff --git a/pkg/sentry/fs/splice.go b/pkg/sentry/fs/splice.go
index 791d1526c..33da82868 100644
--- a/pkg/sentry/fs/splice.go
+++ b/pkg/sentry/fs/splice.go
@@ -167,11 +167,6 @@ 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.