Skip to contentSkip to conversation

vfs: Fix invalid ida_remove() call

PATCH New Takashi Iwai 1 participant 1 message May 10, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/pnode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/pnode.c +2 -1
index 3d2a714..9af0df1 100644
@@ -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);
Signature · 6 lines
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html