Commit ab63f168 authored by Kondo, Uchio's avatar Kondo, Uchio Committed by Andrei Vagin

mount: Add a detailed error message when opts.root is NULL

Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent ae758dc7
...@@ -2476,6 +2476,11 @@ static int do_mount_one(struct mount_info *mi) ...@@ -2476,6 +2476,11 @@ static int do_mount_one(struct mount_info *mi)
pr_debug("\tMounting %s @%s (%d)\n", mi->fstype->name, mi->mountpoint, mi->need_plugin); pr_debug("\tMounting %s @%s (%d)\n", mi->fstype->name, mi->mountpoint, mi->need_plugin);
if (rst_mnt_is_root(mi)) { if (rst_mnt_is_root(mi)) {
if (opts.root == NULL) {
pr_err("The --root option is required to restore a mount namespace\n");
return -1;
}
/* do_mount_root() is called from populate_mnt_ns() */ /* do_mount_root() is called from populate_mnt_ns() */
if (mount(opts.root, mi->mountpoint, NULL, MS_BIND | MS_REC, NULL)) if (mount(opts.root, mi->mountpoint, NULL, MS_BIND | MS_REC, NULL))
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment