From 592f5bdc675ae2933919b649b45551c6781c7876 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 5 Dec 2018 12:45:35 -0800 Subject: Add context to mount errors This makes it more obvious why a mount failed. PiperOrigin-RevId: 224203880 Change-Id: I7961774a7b6fdbb5493a791f8b3815c49b8f7631 --- pkg/sentry/fs/overlay.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/sentry/fs') diff --git a/pkg/sentry/fs/overlay.go b/pkg/sentry/fs/overlay.go index 036c0f733..8ace4ee64 100644 --- a/pkg/sentry/fs/overlay.go +++ b/pkg/sentry/fs/overlay.go @@ -95,10 +95,10 @@ func isXattrOverlay(name string) bool { // - lower must not have dynamic file/directory content. func NewOverlayRoot(ctx context.Context, upper *Inode, lower *Inode, flags MountSourceFlags) (*Inode, error) { if !IsDir(upper.StableAttr) { - return nil, fmt.Errorf("upper Inode is not a directory") + return nil, fmt.Errorf("upper Inode is a %v, not a directory", upper.StableAttr.Type) } if !IsDir(lower.StableAttr) { - return nil, fmt.Errorf("lower Inode is not a directory") + return nil, fmt.Errorf("lower Inode is a %v, not a directory", lower.StableAttr.Type) } if upper.overlay != nil { return nil, fmt.Errorf("cannot nest overlay in upper file of another overlay") -- cgit v1.2.3