From: Takashi Iwai Date: Thu, 23 May 2013 00:37:05 +0000 (+1000) Subject: vfs: fix invalid ida_remove() call X-Git-Tag: next-20130527~1^2~235 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=84e858873bf653f72422623e3736631ac7f3d0d4;p=karo-tx-linux.git vfs: fix invalid ida_remove() call 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. Signed-off-by: Takashi Iwai Reported-by: Cristian Rodríguez Cc: Al Viro Signed-off-by: Andrew Morton --- diff --git a/fs/pnode.c b/fs/pnode.c index 3d2a7141b87a..9af0df15256e 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -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);