Re: panic in NFS/UDP code path

From: Mohan Srinivasan <mohan_srinivasan_at_yahoo.com>
Date: Tue, 26 Jul 2005 16:52:29 -0700 (PDT)
Yes. The bug is caused by the change that made nfs_timer() MPSAFE,
and the patch Maxime attached should fix it.

I'll get that committed soon.

thanks

mohan

--- Maxime Henrion <mux_at_FreeBSD.org> wrote:

> Jeremie Le Hen wrote:
> > Hi all,
> > 
> > while doing a cvs diff with the repository living on an NFS mounted
> > volume, here is the panic I caught :
> > %%%
> >     panic: mutex Giant not owned at ../../../netinet/ip_output.c:151
> >     KDB: stack backtrace:
> >     kdb_backtrace()
> >     panic()
> >     _mtx_assert(c07a0a40,1,c07476c1,97,e5036b6c) at _mtx_assert+0x7c
> >     ip_output(c2639200,0,e5036b70,0,0) at ip_output+0xcb
> >     udp_output(c25f15a0,c2639200,0,0,c2307c80) at udp_output+0x550
> >     udp_send(c2a8e42c,0,c268a300,0,0) at udp_send+0x30
> >     nfs_timer(0,0,c073d3fc,125,c0777100) at nfs_timer+0x2b2
> >     softclock(0,0,c0739ca4,251,e5036d00) at softclock+0x29b
> >     ithread_loop()
> >     fork_exit()
> >     fork_trampoline()
> > %%%
> > 
> > I have a kernel dump, but it's very heavy (1 GB), so tell me what
> > commands you want me to issue in kgdb.
> > 
> > The source are dated from the 2005.07.24... (I can't check the exact
> > date now, it's dumping ;p).
> 
> You are running with debug.mpsafenet=0 ?
> 
> This looks like a fallout from an earlier change to make nfs_timer()
> MPSAFE.  I believe something like the atatched patch is needed, but ps_at_
> would know best about this one.
> 
> Cheers,
> Maxime
> > ? nfs_socket.patch
> Index: nfs_socket.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/nfsclient/nfs_socket.c,v
> retrieving revision 1.128
> diff -u -r1.128 nfs_socket.c
> --- nfs_socket.c	19 Jul 2005 21:27:25 -0000	1.128
> +++ nfs_socket.c	26 Jul 2005 23:39:32 -0000
> _at__at_ -1255,12 +1255,14 _at__at_
>  			 */
>  			rep->r_flags |= R_REXMIT_INPROG;
>  			mtx_unlock(&nfs_reqq_mtx);
> +			NET_LOCK_GIANT();
>  			if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
>  			    error = (*so->so_proto->pr_usrreqs->pru_send)
>  				    (so, 0, m, NULL, NULL, curthread);
>  			else
>  			    error = (*so->so_proto->pr_usrreqs->pru_send)
>  				    (so, 0, m, nmp->nm_nam, NULL, curthread);
> +			NET_UNLOCK_GIANT();
>  			mtx_lock(&nfs_reqq_mtx);
>  			rep->r_flags &= ~R_REXMIT_INPROG;
>  			wakeup((caddr_t)&rep->r_flags);
> > _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Tue Jul 26 2005 - 21:52:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:39 UTC