Skip to content

Commit fb924b7

Browse files
author
Al Viro
committed
change_mnt_propagation(): calculate propagation source only if we'll need it
We only need it when mount in question was sending events downstream (then recepients need to switch to new master) or the mount is being turned into slave (then we need a new master for it). That wouldn't be a big deal, except that it causes quite a bit of work when umount_tree() is taking a large peer group out. Adding a trivial "don't bother calling propagation_source() unless we are going to use its results" logics improves the things quite a bit. We are still doing unnecessary work on bulk removals from propagation graph, but the full solution for that will have to wait for the next merge window. Fixes: 955336e "do_make_slave(): choose new master sanely" Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent cffd044 commit fb924b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/pnode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ void change_mnt_propagation(struct mount *mnt, int type)
111111
return;
112112
}
113113
if (IS_MNT_SHARED(mnt)) {
114-
m = propagation_source(mnt);
114+
if (type == MS_SLAVE || !hlist_empty(&mnt->mnt_slave_list))
115+
m = propagation_source(mnt);
115116
if (list_empty(&mnt->mnt_share)) {
116117
mnt_release_group_id(mnt);
117118
} else {

0 commit comments

Comments
 (0)