diff options
author | Michael Pratt <mpratt@google.com> | 2018-12-05 12:45:35 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-12-05 12:46:30 -0800 |
commit | 592f5bdc675ae2933919b649b45551c6781c7876 (patch) | |
tree | a1a9613786541ce7ccc70bb1dfdb8cd832ceeacb /pkg | |
parent | 06131fe749e3715534f9d551528d89048ae1398b (diff) |
Add context to mount errors
This makes it more obvious why a mount failed.
PiperOrigin-RevId: 224203880
Change-Id: I7961774a7b6fdbb5493a791f8b3815c49b8f7631
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/sentry/fs/overlay.go | 4 |
1 files changed, 2 insertions, 2 deletions
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") |