[PATCH] mount: skip all mounts from a shared group if one is marked

From: Andrei Vagin
Date: Tue Oct 25 2016 - 16:57:31 EST


If we meet a marked mount, it means that all mounts from
its group have been already revised.

Signed-off-by: Andrei Vagin <avagin@xxxxxxxxxx>
---
fs/pnode.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/fs/pnode.c b/fs/pnode.c
index 8fd1a3f..ebb7134 100644
--- a/fs/pnode.c
+++ b/fs/pnode.c
@@ -426,10 +426,16 @@ static struct mount *propagation_visit_child(struct mount *last_child,
if (child && !IS_MNT_MARKED(child))
return child;

- if (!child)
+ if (!child) {
m = propagation_next(m, origin);
- else
+ } else {
+ if (IS_MNT_MARKED(child)) {
+ if (m->mnt_group_id == origin->mnt_group_id)
+ return NULL;
+ m = m->mnt_master;
+ }
m = propagation_next_sib(m, origin);
+ }
}
return NULL;
}
@@ -456,8 +462,14 @@ static struct mount *propagation_revisit_child(struct mount *last_child,

if (!child)
m = propagation_next(m, origin);
- else
+ else {
+ if (!IS_MNT_MARKED(child)) {
+ if (m->mnt_group_id == origin->mnt_group_id)
+ return NULL;
+ m = m->mnt_master;
+ }
m = propagation_next_sib(m, origin);
+ }
}
return NULL;
}
--
2.7.4


--envbJBWh7q8WU6mo--