Skip to content

Commit f6cc2f4

Browse files
author
Al Viro
committed
invent_group_ids(): zero ->mnt_group_id always implies !IS_MNT_SHARED()
All places where we call set_mnt_shared() are guaranteed to have non-zero ->mnt_group_id - either by explicit test, or by having done successful invent_group_ids() covering the same mount since we'd grabbed namespace_sem. The opposite combination (non-zero ->mnt_group_id and !IS_MNT_SHARED()) *is* possible - it means that we have allocated group id, but didn't get around to set_mnt_shared() yet; such state is transient - by the time we do namespace_unlock(), we must either do set_mnt_shared() or unroll the group id allocations by cleanup_group_ids(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 725ab43 commit f6cc2f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ static int invent_group_ids(struct mount *mnt, bool recurse)
25162516
struct mount *p;
25172517

25182518
for (p = mnt; p; p = recurse ? next_mnt(p, mnt) : NULL) {
2519-
if (!p->mnt_group_id && !IS_MNT_SHARED(p)) {
2519+
if (!p->mnt_group_id) {
25202520
int err = mnt_alloc_group_id(p);
25212521
if (err) {
25222522
cleanup_group_ids(mnt, p);

0 commit comments

Comments
 (0)