From a2ec391dfbc5a03077b73078777a9347c372dece Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Fri, 10 Aug 2018 17:15:27 -0700 Subject: fs: Allow overlays to revalidate files from the upper fs. Previously, an overlay would panic if either the upper or lower fs required revalidation for a given Dirent. Now, we allow revalidation from the upper file, but not the lower. If a cached overlay inode does need revalidation (because the upper needs revalidation), then the entire overlay Inode will be discarded and a new overlay Inode will be built with a fresh copy of the upper file. As a side effect of this change, Revalidate must take an Inode instead of a Dirent, since an overlay needs to revalidate individual Inodes. PiperOrigin-RevId: 208293638 Change-Id: Ic8f8d1ffdc09114721745661a09522b54420c5f1 --- pkg/sentry/fs/mock.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/sentry/fs/mock.go') diff --git a/pkg/sentry/fs/mock.go b/pkg/sentry/fs/mock.go index dc82a2002..89a0103ba 100644 --- a/pkg/sentry/fs/mock.go +++ b/pkg/sentry/fs/mock.go @@ -68,7 +68,7 @@ func NewMockMountSource(cache *DirentCache) *MountSource { } // Revalidate implements fs.MountSourceOperations.Revalidate. -func (n *MockMountSourceOps) Revalidate(context.Context, *Dirent) bool { +func (n *MockMountSourceOps) Revalidate(context.Context, *Inode) bool { return n.revalidate } -- cgit v1.2.3