]> Pileus Git - ~andy/linux/commitdiff
vfs: Fix invalid ida_remove() call
authorTakashi Iwai <tiwai@suse.de>
Fri, 10 May 2013 12:04:11 +0000 (14:04 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 31 May 2013 19:16:33 +0000 (15:16 -0400)
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 <crrodriguez@opensuse.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/pnode.c

index 3d2a7141b87a4b38a1aea383a68810ada1271404..9af0df15256e9405082fdb59d1a2c6fe97fb8e59 100644 (file)
@@ -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);