Skip to content

Commit 35988ab

Browse files
authored
Merge pull request #4157 from kinvolk/rata/idmap-errormsg
libct: Improve error msg when idmap is not supported
2 parents c48c428 + a7c3e07 commit 35988ab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libcontainer/mount_linux.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,12 @@ func mountFd(nsHandles *userns.Handles, m *configs.Mount) (*mountSource, error)
258258
Attr_set: unix.MOUNT_ATTR_IDMAP,
259259
Userns_fd: uint64(usernsFile.Fd()),
260260
}); err != nil {
261-
return nil, fmt.Errorf("failed to set MOUNT_ATTR_IDMAP on %s: %w", m.Source, err)
261+
extraMsg := ""
262+
if err == unix.EINVAL {
263+
extraMsg = " (maybe the filesystem used doesn't support idmap mounts on this kernel?)"
264+
}
265+
266+
return nil, fmt.Errorf("failed to set MOUNT_ATTR_IDMAP on %s: %w%s", m.Source, err, extraMsg)
262267
}
263268
} else {
264269
var err error

0 commit comments

Comments
 (0)