From 6f73d79c32594cb85cc00b1eaf72bf4c1def2a79 Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Thu, 30 May 2019 17:19:00 -0700 Subject: [PATCH] Simplify overlayBoundEndpoint. There is no reason to do the recursion manually, since Inode.BoundEndpoint will do it for us. PiperOrigin-RevId: 250794903 --- pkg/sentry/fs/inode_overlay.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/sentry/fs/inode_overlay.go b/pkg/sentry/fs/inode_overlay.go index ea574224f..cdffe173b 100644 --- a/pkg/sentry/fs/inode_overlay.go +++ b/pkg/sentry/fs/inode_overlay.go @@ -433,12 +433,7 @@ func overlayBoundEndpoint(o *overlayEntry, path string) transport.BoundEndpoint return o.upper.InodeOperations.BoundEndpoint(o.upper, path) } - // 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) + return o.lower.BoundEndpoint(path) } func overlayGetFile(ctx context.Context, o *overlayEntry, d *Dirent, flags FileFlags) (*File, error) {