From 0d71d29b6da52d2aa1aa4e69cdf509980b2fb28f Mon Sep 17 00:00:00 2001 From: Lucas Manning Date: Tue, 30 Apr 2024 10:42:55 -0700 Subject: [PATCH] Log the correct path in mount promise timeout panic message. PiperOrigin-RevId: 629460961 --- pkg/sentry/vfs/vfs.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/sentry/vfs/vfs.go b/pkg/sentry/vfs/vfs.go index 8a9e0246e..7a0f3dbfa 100644 --- a/pkg/sentry/vfs/vfs.go +++ b/pkg/sentry/vfs/vfs.go @@ -959,7 +959,10 @@ func (vfs *VirtualFilesystem) maybeBlockOnMountPromise(ctx context.Context, rp * mp.wq.EventRegister(&e) defer mp.wq.EventUnregister(&e) - var path string + var ( + path string + err error + ) // Unblock waiter entries that were created after this mount promise was // resolved by a racing thread. if mp.resolved.Load() { @@ -967,7 +970,7 @@ func (vfs *VirtualFilesystem) maybeBlockOnMountPromise(ctx context.Context, rp * } else { root := RootFromContext(ctx) defer root.DecRef(ctx) - path, err := vfs.PathnameReachable(ctx, root, vd) + path, err = vfs.PathnameReachable(ctx, root, vd) if err != nil { panic(fmt.Sprintf("could not reach %v from root", rp.Component())) }