mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +00:00
mount: don't take into acount the root master_id
It's an external one and it's already created and we don't have proper shared mount. 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
db91c9a934
commit
41a0035dd4
11
mount.c
11
mount.c
@@ -914,6 +914,7 @@ static int resolve_external_mounts(struct mount_info *info)
|
|||||||
static int resolve_shared_mounts(struct mount_info *info)
|
static int resolve_shared_mounts(struct mount_info *info)
|
||||||
{
|
{
|
||||||
struct mount_info *m, *t;
|
struct mount_info *m, *t;
|
||||||
|
int root_master_id = info->master_id;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have a shared mounts, both master
|
* If we have a shared mounts, both master
|
||||||
@@ -924,8 +925,12 @@ static int resolve_shared_mounts(struct mount_info *info)
|
|||||||
for (m = info; m; m = m->next) {
|
for (m = info; m; m = m->next) {
|
||||||
bool need_share, need_master;
|
bool need_share, need_master;
|
||||||
|
|
||||||
|
/* the root master_id can be ignored, because it's already created */
|
||||||
|
if (root_master_id == m->master_id)
|
||||||
|
m->master_id = -1;
|
||||||
|
|
||||||
need_share = m->shared_id && list_empty(&m->mnt_share);
|
need_share = m->shared_id && list_empty(&m->mnt_share);
|
||||||
need_master = m->master_id;
|
need_master = m->master_id > 0;
|
||||||
|
|
||||||
pr_debug("Inspecting sharing on %2d shared_id %d master_id %d (@%s)\n",
|
pr_debug("Inspecting sharing on %2d shared_id %d master_id %d (@%s)\n",
|
||||||
m->mnt_id, m->shared_id, m->master_id, m->mountpoint);
|
m->mnt_id, m->shared_id, m->master_id, m->mountpoint);
|
||||||
@@ -2178,7 +2183,7 @@ skip_parent:
|
|||||||
continue;
|
continue;
|
||||||
if (t->bind)
|
if (t->bind)
|
||||||
continue;
|
continue;
|
||||||
if (t->master_id)
|
if (t->master_id > 0)
|
||||||
continue;
|
continue;
|
||||||
t->bind = mi;
|
t->bind = mi;
|
||||||
t->s_dev_rt = mi->s_dev_rt;
|
t->s_dev_rt = mi->s_dev_rt;
|
||||||
@@ -2428,7 +2433,7 @@ static bool can_mount_now(struct mount_info *mi)
|
|||||||
* - Make sure all children is mounted as well to
|
* - Make sure all children is mounted as well to
|
||||||
* eliminame mounts duplications
|
* eliminame mounts duplications
|
||||||
*/
|
*/
|
||||||
if (mi->master_id) {
|
if (mi->master_id > 0) {
|
||||||
struct mount_info *c;
|
struct mount_info *c;
|
||||||
|
|
||||||
if (mi->bind == NULL)
|
if (mi->bind == NULL)
|
||||||
|
Reference in New Issue
Block a user