From owner-freebsd-current@FreeBSD.ORG Mon Mar 3 20:16:26 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EE1A1065671 for ; Mon, 3 Mar 2008 20:16:26 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by mx1.freebsd.org (Postfix) with ESMTP id 32E578FC13 for ; Mon, 3 Mar 2008 20:16:25 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so2316915uge.37 for ; Mon, 03 Mar 2008 12:16:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=luj1VdOlHbMfoSPZpPurvfXEcnLitddiu7poiUxFsr0=; b=XMPtZk2wvCP8O8xvB/De4KKm+m/OltiL7+9QFiaBF7Pvj4aFDfqWP3kmJhLhjOYSgpcqMfdXTMtF40qEgIVY9WDDSovjv2IaWhBveLG4QHl9So4GscQetagopdbDr0sx9e8QSvSgjaooU8sb+fKEcH/UfCM6FNOrkVRXYKRXtSY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UosgGHHMCsYqYNZ3garK7oRlVOj14S8aX+WYmZyM/EI7yprBPyWxcgljtzVkHi5jBL0isTab+/4prk4cZFSrEtDpRIkU7q8/wYcqHqf7tCm3kIDy4zHXkrXB4H94ppHHYCJG0mWIws+QgQXeeYozOKRWMZFLyH5Mlmlv4amd894= Received: by 10.78.141.12 with SMTP id o12mr1246875hud.22.1204575383912; Mon, 03 Mar 2008 12:16:23 -0800 (PST) Received: by 10.78.46.11 with HTTP; Mon, 3 Mar 2008 12:16:23 -0800 (PST) Message-ID: Date: Mon, 3 Mar 2008 23:16:23 +0300 From: pluknet To: "Kostik Belousov" In-Reply-To: <20080303192327.GY57756@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080303133406.GV57756@deviant.kiev.zoral.com.ua> <20080303164353.GW57756@deviant.kiev.zoral.com.ua> <20080303192327.GY57756@deviant.kiev.zoral.com.ua> Cc: FreeBSD Current Subject: Re: panic: mutex Giant owned at nfs_syscalls.c:556 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2008 20:16:26 -0000 On 03/03/2008, Kostik Belousov wrote: > On Mon, Mar 03, 2008 at 09:27:15PM +0300, pluknet wrote: > > On 03/03/2008, Kostik Belousov wrote: > > [snip] > > > To summarize, I need both the tcpdump and kernel/witness messages from > > > the panic. > > > > > > > I'm sorry. Here it is. > > http://pluknet.nm.ru/dev/tcpdump-nfsserver-full.raw > > > > 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 = 0 (0xc2e0af40) locked @ > > /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_syscalls.c:501 > > exclusive sleep mutex Giant r = 0 (0xc07e6410) locked @ > > /usr/src/sys/kern/vfs_lookup.c:663 > > > > > 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 = NULL; > > > - int vfslocked; > > > + int vfslocked, vfslocked1; > > > > > > nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); > > > ndclear(&nd); > > > @@ -2168,7 +2168,11 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, > > > nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | MPSAFE; > > > error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos, > > > &dirp, v3, &dirfor, &dirfor_ret, td, FALSE); > > > - vfslocked = NDHASGIANT(&nd); > > > + vfslocked1 = NDHASGIANT(&nd); > > > + if (vfslocked && vfslocked1) > > > + VFS_UNLOCK_GIANT(vfslocked1); > > > + if (vfslocked || vfslocked1) > > > + vfslocked = 1; > > > if (dirp && !v3) { > > > vrele(dirp); > > > dirp = NULL; > > > > > > > > > > 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 > > > > 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. Of course. That another situation is while performing /etc/rc.d/nfsd stop > System call nfssvc returning with the following locks held: > exclusive sleep mutex Giant r = 2 (0xc07e6410) locked @ > /usr/src/sys/modules/nfsserver/../../nfsserver/nfs_srvsubs.c:1106 > panic: witness_warn I got no panic with this patch: # /etc/rc.d/nfsd stop Stopping nfsd. kill: 1737: No such process kill: 1738: No such process kill: 1739: No such process kill: 1740: No such process # wbr, pluknet