diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2019-03-29 12:25:17 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-03-29 12:26:25 -0700 |
commit | ed23f547093e705ba3d6f82b2ce49592180f9a5a (patch) | |
tree | 973becebd4992b41a0d5791a93e3a36745052d82 /pkg/sentry/kernel | |
parent | 45c54b1f4e2bb6fcad14b8b7734d6a1847329901 (diff) |
Treat ENOSPC as a state-file error during save.
PiperOrigin-RevId: 241028806
Change-Id: I770bf751a2740869a93c3ab50370a727ae580470
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r-- | pkg/sentry/kernel/kernel.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/kernel.go b/pkg/sentry/kernel/kernel.go index 3533fd8f7..d9f3f4e24 100644 --- a/pkg/sentry/kernel/kernel.go +++ b/pkg/sentry/kernel/kernel.go @@ -365,6 +365,11 @@ func (ts *TaskSet) flushWritesToFiles(ctx context.Context) error { syncErr := desc.file.Fsync(ctx, 0, fs.FileMaxOffset, fs.SyncAll) if err := fs.SaveFileFsyncError(syncErr); err != nil { name, _ := desc.file.Dirent.FullName(nil /* root */) + // Wrapping this error not only allows + // for a more useful message, but is + // required to distinguish Fsync errors + // from state file errors in + // state.Save. return fmt.Errorf("%q was not sufficiently synced: %v", name, err) } } |