mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
mount: stop doing anything if populate_mnt_ns() failed
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
96a12d4755
commit
7094e110a3
4
mount.c
4
mount.c
@@ -3161,6 +3161,8 @@ int prepare_mnt_ns(void)
|
|||||||
ret = populate_mnt_ns();
|
ret = populate_mnt_ns();
|
||||||
if (!ret && opts.root)
|
if (!ret && opts.root)
|
||||||
ret = cr_pivot_root(NULL);
|
ret = cr_pivot_root(NULL);
|
||||||
|
if (ret)
|
||||||
|
return -1;
|
||||||
|
|
||||||
rst = open_proc(PROC_SELF, "ns/mnt");
|
rst = open_proc(PROC_SELF, "ns/mnt");
|
||||||
if (rst < 0)
|
if (rst < 0)
|
||||||
@@ -3207,7 +3209,7 @@ int prepare_mnt_ns(void)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
err:
|
err:
|
||||||
if (rst)
|
if (rst >= 0)
|
||||||
restore_ns(rst, &mnt_ns_desc);
|
restore_ns(rst, &mnt_ns_desc);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user