diff options
author | Jamie Liu <jamieliu@google.com> | 2020-08-07 16:33:37 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-07 16:35:20 -0700 |
commit | 0b7cd1e751f70cf6b335754d2b173d9c12b674c7 (patch) | |
tree | 3e7ed28ad637f2a22a5d2f7504cbce497463e979 /pkg/sentry | |
parent | 80c80a14101aca90ee21aa6f6c934673c50e6cee (diff) |
Mark dropped pages unevictable in fsimpl/gofer.dentry.destroyLocked.
PiperOrigin-RevId: 325531657
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/fsimpl/gofer/gofer.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/sentry/fsimpl/gofer/gofer.go b/pkg/sentry/fsimpl/gofer/gofer.go index f1d3bf911..4ac8dd81d 100644 --- a/pkg/sentry/fsimpl/gofer/gofer.go +++ b/pkg/sentry/fsimpl/gofer/gofer.go @@ -1264,8 +1264,11 @@ func (d *dentry) destroyLocked(ctx context.Context) { } } // Discard cached data. - d.cache.DropAll(mf) - d.dirty.RemoveAll() + if !d.cache.IsEmpty() { + mf.MarkAllUnevictable(d) + d.cache.DropAll(mf) + d.dirty.RemoveAll() + } d.dataMu.Unlock() // Clunk open fids and close open host FDs. if !d.readFile.isNil() { |