From: Al Viro Date: Wed, 25 Jun 2025 19:10:52 +0000 (-0400) Subject: statmount_mnt_basic(): simplify the logics for group id X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7cce099450f8fc597a6ac215440666610895fb7;p=thirdparty%2Flinux.git statmount_mnt_basic(): simplify the logics for group id We are holding namespace_sem shared and we have not done any group id allocations since we grabbed it. Therefore IS_MNT_SHARED(m) is equivalent to non-zero m->mnt_group_id. Signed-off-by: Al Viro --- diff --git a/fs/namespace.c b/fs/namespace.c index a75438121417d..c549bd39c210a 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -5298,7 +5298,7 @@ static void statmount_mnt_basic(struct kstatmount *s) s->sm.mnt_parent_id_old = m->mnt_parent->mnt_id; s->sm.mnt_attr = mnt_to_attr_flags(&m->mnt); s->sm.mnt_propagation = mnt_to_propagation_flags(m); - s->sm.mnt_peer_group = IS_MNT_SHARED(m) ? m->mnt_group_id : 0; + s->sm.mnt_peer_group = m->mnt_group_id; s->sm.mnt_master = IS_MNT_SLAVE(m) ? m->mnt_master->mnt_group_id : 0; }