Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Mar 2008 21:23:27 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        pluknet <pluknet@gmail.com>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: panic: mutex Giant owned at nfs_syscalls.c:556
Message-ID:  <20080303192327.GY57756@deviant.kiev.zoral.com.ua>
In-Reply-To: <a31046fc0803031027y6b126b9alb6899e470c8e109c@mail.gmail.com>
References:  <a31046fc0802200328i31833093i15ac0db5e764b40a@mail.gmail.com> <a31046fc0803021841k752ac5afx8ccd7d08784da713@mail.gmail.com> <20080303133406.GV57756@deviant.kiev.zoral.com.ua> <a31046fc0803030814v53b80b0ey6808b0aacf4e028e@mail.gmail.com> <20080303164353.GW57756@deviant.kiev.zoral.com.ua> <a31046fc0803031027y6b126b9alb6899e470c8e109c@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--6TtjFmcAvNOgfSd8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Mar 03, 2008 at 09:27:15PM +0300, pluknet wrote:
> On 03/03/2008, Kostik Belousov <kostikbel@gmail.com> wrote:
> [snip]
> >  To summarize, I need both the tcpdump and kernel/witness messages from
> >  the panic.
> >
>=20
> I'm sorry. Here it is.
> http://pluknet.nm.ru/dev/tcpdump-nfsserver-full.raw
>=20
> The messages (same as unread msgbuf in initial posting, hand-scribed):
> panic: mutex Giant owned at
> /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_syscalls.c:556
> KDB: enter: panic
> [thread pid 601 tid 100055 ]
> Stopped at kdb_enter+0x3a: movl $0,kdb_why
> db> show locks
> exclusive sleep mutex nfsd_mtx r =3D 0 (0xc2e0af40) locked @
> /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_syscalls.c:501
> exclusive sleep mutex Giant r =3D 0 (0xc07e6410) locked @
> /usr/src/sys/kern/vfs_lookup.c:663
>=20
> >  Nevertheless, the patch below might help with the panic during
> >  the unlinking (not tested).
> >
> >  diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
> >  index 446651d..87e1aaa 100644
> >  --- a/sys/nfsserver/nfs_serv.c
> >  +++ b/sys/nfsserver/nfs_serv.c
> >  @@ -2146,7 +2146,7 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct=
 nfssvc_sock *slp,
> >         nfsfh_t nfh;
> >         fhandle_t *fhp;
> >         struct mount *mp =3D NULL;
> >  -       int vfslocked;
> >  +       int vfslocked, vfslocked1;
> >
> >         nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
> >         ndclear(&nd);
> >  @@ -2168,7 +2168,11 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struc=
t nfssvc_sock *slp,
> >         nd.ni_cnd.cn_flags =3D LOCKPARENT | LOCKLEAF | MPSAFE;
> >         error =3D nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos,
> >                 &dirp, v3,  &dirfor, &dirfor_ret, td, FALSE);
> >  -       vfslocked =3D NDHASGIANT(&nd);
> >  +       vfslocked1 =3D NDHASGIANT(&nd);
> >  +       if (vfslocked && vfslocked1)
> >  +               VFS_UNLOCK_GIANT(vfslocked1);
> >  +       if (vfslocked || vfslocked1)
> >  +               vfslocked =3D 1;
> >         if (dirp && !v3) {
> >                 vrele(dirp);
> >                 dirp =3D NULL;
> >
> >
>=20
> Now the last lock triplex looks like:
> vfslocked lock in
> /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_serv.c, 2161
> vfslocked lock in
> /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_srvsubs.c, 1106
> vfslocked lock in
> /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_srvsubs.c, 673
> vfslocked unlock in
> /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_srvsubs.c, 916
> vfslocked1 unlock in
> /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_serv.c, 2173
> ^^^
> vfslocked unlock in
> /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_serv.c, 2238
>=20
> And no panic. Thanks.

Could you, please, clarify. As I read you mail, the patch fixed at least
one of your panic. Are there any other situations where nfs server over
non-MPSAFE fs panics for you ? It is possible that what you reported
before actually contains several different reasons for Giant leak.

--6TtjFmcAvNOgfSd8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iEYEARECAAYFAkfMUC4ACgkQC3+MBN1Mb4iBOQCfTE1uPwwaBf4/arV1N+zymAN5
4RcAn2kz6j7Nl0IXSutXACdqtHoYid/M
=BpwV
-----END PGP SIGNATURE-----

--6TtjFmcAvNOgfSd8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080303192327.GY57756>