summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/mount_overlay.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-07-17 23:20:44 +0000
committergVisor bot <gvisor-bot@google.com>2019-07-17 23:20:44 +0000
commit9f4e682c1c3b4061308f82f3d9e01de0778d111a (patch)
treee96e4f291fa9c0814053983570511790084437e1 /pkg/sentry/fs/mount_overlay.go
parent85f25d97ff2a21e74052168f05f70b891bd912df (diff)
parent6f7e2bb388cb29a355dece8921671c0085f53ea9 (diff)
Merge 6f7e2bb3 (automated)
Diffstat (limited to 'pkg/sentry/fs/mount_overlay.go')
-rw-r--r--pkg/sentry/fs/mount_overlay.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/pkg/sentry/fs/mount_overlay.go b/pkg/sentry/fs/mount_overlay.go
index 4fcdd6c01..299712cd7 100644
--- a/pkg/sentry/fs/mount_overlay.go
+++ b/pkg/sentry/fs/mount_overlay.go
@@ -66,13 +66,17 @@ func (o *overlayMountSourceOperations) Revalidate(ctx context.Context, name stri
panic("an overlay cannot revalidate file objects from the lower fs")
}
- // Do we have anything to revalidate?
- if child.overlay.upper == nil {
- return false
+ var revalidate bool
+ child.overlay.copyMu.RLock()
+ if child.overlay.upper != nil {
+ // Does the upper require revalidation?
+ revalidate = o.upper.Revalidate(ctx, name, parent.overlay.upper, child.overlay.upper)
+ } else {
+ // Nothing to revalidate.
+ revalidate = false
}
-
- // Does the upper require revalidation?
- return o.upper.Revalidate(ctx, name, parent.overlay.upper, child.overlay.upper)
+ child.overlay.copyMu.RUnlock()
+ return revalidate
}
// Keep implements MountSourceOperations by delegating to the upper