mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Take copyMu in Revalidate
copyMu is required to read child.overlay.upper. PiperOrigin-RevId: 258662209
This commit is contained in:
committed by
gVisor bot
parent
2bc398bfd8
commit
6f7e2bb388
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user