overlayBoundEndpoint must be recursive if there is an overlay in the lower.

The old overlayBoundEndpoint assumed that the lower is not an overlay.  It
should check if the lower is an overlay and handle that case.

PiperOrigin-RevId: 225882303
Change-Id: I60660c587d91db2826e0719da0983ec8ad024cb8
This commit is contained in:
Nicolas Lacasse
2018-12-17 13:46:57 -08:00
committed by Shentubot
parent f7e8dc57c5
commit d3ae74d2a5
+6 -2
View File
@@ -390,8 +390,12 @@ func overlayBoundEndpoint(o *overlayEntry, path string) transport.BoundEndpoint
if o.upper != nil {
return o.upper.InodeOperations.BoundEndpoint(o.upper, path)
}
// If a socket is already in the lower file system, allow connections
// to it.
// If the lower is itself an overlay, recurse.
if o.lower.overlay != nil {
return overlayBoundEndpoint(o.lower.overlay, path)
}
// Lower is not an overlay. Call BoundEndpoint directly.
return o.lower.InodeOperations.BoundEndpoint(o.lower, path)
}