Commit 41a0035d authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

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: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent db91c9a9
...@@ -914,6 +914,7 @@ static int resolve_external_mounts(struct mount_info *info) ...@@ -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) ...@@ -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: ...@@ -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) ...@@ -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)
......
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