summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/ext/extent_file.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/fs/ext/extent_file.go')
-rw-r--r--pkg/sentry/fs/ext/extent_file.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/sentry/fs/ext/extent_file.go b/pkg/sentry/fs/ext/extent_file.go
index 44fb9c01f..1b9bf449b 100644
--- a/pkg/sentry/fs/ext/extent_file.go
+++ b/pkg/sentry/fs/ext/extent_file.go
@@ -150,7 +150,11 @@ func (f *extentFile) ReadAt(dst []byte, off int64) (int, error) {
return 0, io.EOF
}
- return f.read(&f.root, uint64(off), dst)
+ n, err := f.read(&f.root, uint64(off), dst)
+ if n < len(dst) && err == nil {
+ err = io.EOF
+ }
+ return n, err
}
// read is the recursive step of extentFile.ReadAt which traverses the extent