summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r--pkg/sentry/kernel/kernel.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/kernel.go b/pkg/sentry/kernel/kernel.go
index 0468dd678..91889b573 100644
--- a/pkg/sentry/kernel/kernel.go
+++ b/pkg/sentry/kernel/kernel.go
@@ -303,7 +303,12 @@ func (k *Kernel) SaveTo(w io.Writer) error {
k.pauseTimeLocked()
defer k.resumeTimeLocked()
+ // Evict all evictable MemoryFile allocations.
+ k.mf.FlushEvictions()
+
// Flush write operations on open files so data reaches backing storage.
+ // This must come after k.mf.FlushEvictions() since eviction may cause file
+ // writes.
if err := k.tasks.flushWritesToFiles(ctx); err != nil {
return err
}