From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Gang Subject: Re: [Suggestion] fs/namespace.c: the direct cause of the warning for: "ida_remove called for id=0 which is not allocated" with mnt_release_group_id() Date: Fri, 24 May 2013 09:26:47 +0800 Message-ID: <519EC1D7.1000402@asianux.com> References: <5191FE96.6050607@asianux.com> <20130523161805.1faa0f8c59bfc8ee728d8c7f@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Al Viro , linux-fsdevel@vger.kernel.org, "linux-kernel@vger.kernel.org" , Takashi Iwai To: Andrew Morton Return-path: In-Reply-To: <20130523161805.1faa0f8c59bfc8ee728d8c7f@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 05/24/2013 07:18 AM, Andrew Morton wrote: > On Tue, 14 May 2013 17:06:30 +0800 Chen Gang = wrote: >=20 >> > After call collect_mounts(), then call drop_collected_mounts(), it= will >> > report an warning: "ida_remove called for id=3D0 which is not allo= cated" >> > (one sample is audit_add_tree_rule() in kernel/audit_tree.c). >> >=20 >> > The direct cause (maybe also be the root cause): >> > collect_mounts() passs 'CL_PRIVATE' to copy_tree() -> clone_mnt(= ). >> > it will set "mnt->mnt_group_id =3D 0" in clone_mnt(). >> > when drop_collected_mounts() -> mnt_release_group_id(), 'mnt->mn= t_group_id =3D=3D 0'. > I expect this patch also addresses the bug. Can you please review an= d test it? >=20 I am sure, after apply the patch below, it will be no warning again (fi= x the direct cause). Originally, I want to fix this bug just like the patch below, but I am not quite sure whether it will hide the real root cause. Thanks. >=20 > From: Takashi Iwai > Subject: vfs: fix invalid ida_remove() call >=20 > When the group id of a shared mount is not allocated, the umount stil= l > tries to call mnt_release_group_id(), which eventually hits a kernel > warning at ida_remove() spewing a message like: >=20 > ida_remove called for id=3D0 which is not allocated. >=20 > This patch fixes the bug simply checking the group id in the caller. >=20 > Signed-off-by: Takashi Iwai > Reported-by: Cristian Rodr=EF=BF=BDguez > Cc: Al Viro > Signed-off-by: Andrew Morton > --- >=20 > fs/pnode.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff -puN fs/pnode.c~vfs-fix-invalid-ida_remove-call fs/pnode.c > --- a/fs/pnode.c~vfs-fix-invalid-ida_remove-call > +++ a/fs/pnode.c > @@ -83,7 +83,8 @@ static int do_make_slave(struct mount *m > if (peer_mnt =3D=3D mnt) > peer_mnt =3D 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); > =20 > list_del_init(&mnt->mnt_share); > _ >=20 >=20 >=20 --=20 Chen Gang Asianux Corporation