Skip to content

Commit

Permalink
vfs: Fix invalid ida_remove() call
Browse files Browse the repository at this point in the history
When the group id of a shared mount is not allocated, the umount still
tries to call mnt_release_group_id(), which eventually hits a kernel
warning at ida_remove() spewing a message like:
  ida_remove called for id=0 which is not allocated.

This patch fixes the bug simply checking the group id in the caller.

Reported-by: Cristian Rodríguez <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
tiwai authored and Al Viro committed May 31, 2013
1 parent a93cb29 commit 5d477b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/pnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ static int do_make_slave(struct mount *mnt)
if (peer_mnt == mnt)
peer_mnt = NULL;
}
if (IS_MNT_SHARED(mnt) && list_empty(&mnt->mnt_share))
if (mnt->mnt_group_id && IS_MNT_SHARED(mnt) &&
list_empty(&mnt->mnt_share))
mnt_release_group_id(mnt);

list_del_init(&mnt->mnt_share);
Expand Down

0 comments on commit 5d477b6

Please sign in to comment.