Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Mar 2008 18:43:53 +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:  <20080303164353.GW57756@deviant.kiev.zoral.com.ua>
In-Reply-To: <a31046fc0803030814v53b80b0ey6808b0aacf4e028e@mail.gmail.com>
References:  <a31046fc0802200328i31833093i15ac0db5e764b40a@mail.gmail.com> <a31046fc0803021841k752ac5afx8ccd7d08784da713@mail.gmail.com> <20080303133406.GV57756@deviant.kiev.zoral.com.ua> <a31046fc0803030814v53b80b0ey6808b0aacf4e028e@mail.gmail.com>

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

--FTgtfWvo0NwU+ZJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Mar 03, 2008 at 07:14:54PM +0300, pluknet wrote:
> On 03/03/2008, Kostik Belousov <kostikbel@gmail.com> wrote:
> > I mean the raw dump that can be loaded in wireshark, for instance.
> >  I prefer to not do the manual RPC decoding.
> >
> >
> >  >
> >  > 03:07:59.342714 IP (tos 0x0, ttl 128, id 39253, offset 0, flags
> >  > [none], proto UDP (17), length 136) 192.168.200.185.1968921799 >
> >  > 192.168.200.137.2049: 108 access [|nfs]
> >  >         0x0000:  4500 0088 9955 0000 8011 8e7b c0a8 c8b9
> >  >         0x0010:  c0a8 c889 03f8 0801 0074 3c9e 755b 5cc7
> >  >         0x0020:  0000 0000 0000 0002 0001 86a3 0000 0003
> >  >         0x0030:  0000 0004 0000 0001 0000 0020 0000 0000
> >  >         0x0040:  0000 0000 0000 03e9 0000 03e9 0000 0003
> >  >         0x0050:  0000
> >  > 03:07:59.343818 IP (tos 0x0, ttl 128, id 30823, offset 0, flags
> >  > [none], proto UDP (17), length 148) 192.168.200.137.2049 >
> >  > 192.168.200.185.1968921799: reply ok 120 access attr: REG 755 ids
> >  > 1001/0 [|nfs]
> >  >         0x0000:  4500 0094 7867 0000 8011 af5d c0a8 c889
> >  >         0x0010:  c0a8 c8b9 0801 03f8 0080 1bda 755b 5cc7
> >  >         0x0020:  0000 0001 0000 0000 0000 0000 0000 0000
> >  >         0x0030:  0000 0000 0000 0000 0000 0001 0000 0001
> >  >         0x0040:  0000 01ed 0000 0001 0000 03e9 0000 0000
> >  >         0x0050:  0000
> >  > 03:07:59.344297 IP (tos 0x0, ttl 128, id 20293, offset 0, flags
> >  > [none], proto UDP (17), length 140) 192.168.200.185.1968921800 >
> >  > 192.168.200.137.2049: 112 lookup [|nfs]
> >  >         0x0000:  4500 008c 4f45 0000 8011 d887 c0a8 c8b9
> >  >         0x0010:  c0a8 c889 03f8 0801 0078 58a1 755b 5cc8
> >  >         0x0020:  0000 0000 0000 0002 0001 86a3 0000 0003
> >  >         0x0030:  0000 0003 0000 0001 0000 0020 0000 0000
> >  >         0x0040:  0000 0000 0000 03e9 0000 03e9 0000 0003
> >  >         0x0050:  0000
> >  > 03:07:59.344782 IP (tos 0x0, ttl 128, id 64063, offset 0, flags
> >  > [none], proto UDP (17), length 264) 192.168.200.137.2049 >
> >  > 192.168.200.185.1968921800: reply ok 236 lookup [|nfs]
> >  >         0x0000:  4500 0108 fa3f 0000 8011 2d11 c0a8 c889
> >  >         0x0010:  c0a8 c8b9 0801 03f8 00f4 feb1 755b 5cc8
> >  >         0x0020:  0000 0001 0000 0000 0000 0000 0000 0000
> >  >         0x0030:  0000 0000 0000 0000 0000 001c 5100 0000
> >  >         0x0040:  0400 0000 0c00 0000 4dc9 1000 8001 0000
> >  >         0x0050:  0000
> >  > 03:07:59.345530 IP (tos 0x0, ttl 128, id 32619, offset 0, flags
> >  > [none], proto UDP (17), length 140) 192.168.200.185.1968921801 >
> >  > 192.168.200.137.2049: 112 lookup [|nfs]
> >  >         0x0000:  4500 008c 7f6b 0000 8011 a861 c0a8 c8b9
> >  >         0x0010:  c0a8 c889 03f8 0801 0078 58a0 755b 5cc9
> >  >         0x0020:  0000 0000 0000 0002 0001 86a3 0000 0003
> >  >         0x0030:  0000 0003 0000 0001 0000 0020 0000 0000
> >  >         0x0040:  0000 0000 0000 03e9 0000 03e9 0000 0003
> >  >         0x0050:  0000
> >  > 03:07:59.346752 IP (tos 0x0, ttl 128, id 50548, offset 0, flags
> >  > [none], proto UDP (17), length 264) 192.168.200.137.2049 >
> >  > 192.168.200.185.1968921801: reply ok 236 lookup [|nfs]
> >  >         0x0000:  4500 0108 c574 0000 8011 61dc c0a8 c889
> >  >         0x0010:  c0a8 c8b9 0801 03f8 00f4 feb0 755b 5cc9
> >  >         0x0020:  0000 0001 0000 0000 0000 0000 0000 0000
> >  >         0x0030:  0000 0000 0000 0000 0000 001c 5100 0000
> >  >         0x0040:  0400 0000 0c00 0000 4dc9 1000 8001 0000
> >  >         0x0050:  0000
> >  > 03:07:59.347265 IP (tos 0x0, ttl 128, id 52799, offset 0, flags
> >  > [none], proto UDP (17), length 140) 192.168.200.185.1968921802 >
> >  > 192.168.200.137.2049: 112 remove [|nfs]
> >  >         0x0000:  4500 008c ce3f 0000 8011 598d c0a8 c8b9
> >  >         0x0010:  c0a8 c889 03f8 0801 0078 5896 755b 5cca
> >  >         0x0020:  0000 0000 0000 0002 0001 86a3 0000 0003
> >  >         0x0030:  0000 000c 0000 0001 0000 0020 0000 0000
> >  >         0x0040:  0000 0000 0000 03e9 0000 03e9 0000 0003
> >  >         0x0050:  0000
> >  > 03:07:59.348654 IP (tos 0x0, ttl 128, id 55143, offset 0, flags
> >  > [none], proto UDP (17), length 172) 192.168.200.137.2049 >
> >  > 192.168.200.185.1968921802: reply ok 144 remove PRE: [|nfs]
> >  >         0x0000:  4500 00ac d767 0000 8011 5045 c0a8 c889
> >  >         0x0010:  c0a8 c8b9 0801 03f8 0098 1757 755b 5cca
> >  >         0x0020:  0000 0001 0000 0000 0000 0000 0000 0000
> >  >         0x0030:  0000 0000 0000 0000 0000 0001 0000 0000
> >  >         0x0040:  0000 4000 4099 2bf4 0000 0000 4099 2bf4
> >  >         0x0050:  0000
> >  >
>=20
> Ah, okey, I got it.
> http://pluknet.nm.ru/dev/tcpdump-nfsserver.raw

Oh. You did not specified the unlimited packet snap length (-s 0) ?

And, what was the exact line location where witness reported the Giant
was locked for the dump provided ?

To summarize, I need both the tcpdump and kernel/witness messages from
the panic.

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 nfss=
vc_sock *slp,
 	nfsfh_t nfh;
 	fhandle_t *fhp;
 	struct mount *mp =3D NULL;
-	int vfslocked;
+	int vfslocked, vfslocked1;
=20
 	nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 	ndclear(&nd);
@@ -2168,7 +2168,11 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct nfs=
svc_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;

--FTgtfWvo0NwU+ZJZ
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iEYEARECAAYFAkfMKsgACgkQC3+MBN1Mb4gtLACfS9yQmMoH72o6k7hNJNgelrBz
P/8AoKXz0Sup6mrk4kFmxDqIUEH0jpt6
=Xa9j
-----END PGP SIGNATURE-----

--FTgtfWvo0NwU+ZJZ--



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