From owner-freebsd-current@FreeBSD.ORG Thu Jun 24 14:11:46 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E88EE16A4CE for ; Thu, 24 Jun 2004 14:11:46 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 816F743D39 for ; Thu, 24 Jun 2004 14:11:46 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i5OEAtvN010180; Thu, 24 Jun 2004 10:10:55 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i5OEAs6Z010177; Thu, 24 Jun 2004 10:10:55 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Thu, 24 Jun 2004 10:10:54 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Jun Kuriyama In-Reply-To: <7m3c4lle3k.wl@black3.imgsrc.co.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Current Subject: Re: malloc(M_WAITOK) of "32", forcing M_NOWAIT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Thu, 24 Jun 2004 14:11:47 -0000 On Thu, 24 Jun 2004, Jun Kuriyama wrote: > I don't know how to fix correctly. But it has disappeared with > following patch. Grrr. I think this is not quite correct; you will need to unlock the nfsd_mtx regardless of the state of RC_LOCKED, as that's a structure sleep lock and nfsd_mtx should be locked at that point regardless of RC_LOCKED. Assuming this code was safe on 4.x and performed a blocking socket addr copy here, it should also be safe on 5.x to drop nfsd_mtx here. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research > > Index: nfs_srvcache.c > =================================================================== > RCS file: /home/ncvs/src/sys/nfsserver/nfs_srvcache.c,v > retrieving revision 1.38 > diff -u -r1.38 nfs_srvcache.c > --- nfs_srvcache.c 24 May 2004 04:06:14 -0000 1.38 > +++ nfs_srvcache.c 22 Jun 2004 06:28:12 -0000 > @@ -247,10 +247,19 @@ > break; > /* case AF_INET6: */ > /* case AF_ISO: */ > - default: > + default: { > + struct sockaddr *sa2; > rp->rc_flag |= RC_NAM; > - rp->rc_nam = sodupsockaddr(nd->nd_nam, M_WAITOK); > + if (rp->rc_flag | RC_LOCKED) { > + NFSD_UNLOCK(); > + } > + sa2 = sodupsockaddr(nd->nd_nam, M_WAITOK); > + if (rp->rc_flag | RC_LOCKED) { > + NFSD_LOCK(); > + } > + rp->rc_nam = sa2; > break; > + } > }; > rp->rc_proc = nd->nd_procnum; > LIST_INSERT_HEAD(NFSRCHASH(nd->nd_retxid), rp, rc_hash); > > > -- > Jun Kuriyama // IMG SRC, Inc. > // FreeBSD Project > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >