From owner-freebsd-arch@FreeBSD.ORG Thu Jan 12 21:51:11 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51C9D1065677; Thu, 12 Jan 2012 21:51:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id BC08D8FC13; Thu, 12 Jan 2012 21:51:10 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0CLp7Ak065365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jan 2012 23:51:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0CLp6Fs087118; Thu, 12 Jan 2012 23:51:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0CLp6Wu087117; Thu, 12 Jan 2012 23:51:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Jan 2012 23:51:06 +0200 From: Kostik Belousov To: "Robert N. M. Watson" Message-ID: <20120112215106.GC31224@deviant.kiev.zoral.com.ua> References: <86sjjobzmn.fsf@kopusha.home.net> <86fwfnti5t.fsf@kopusha.home.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hS91mLTIjizZlFCb" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Mikolaj Golub , freebsd-arch@freebsd.org Subject: Re: unix domain sockets on nullfs(5) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 21:51:11 -0000 --hS91mLTIjizZlFCb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 12, 2012 at 09:39:53PM +0000, Robert N. M. Watson wrote: >=20 > On 12 Jan 2012, at 21:17, Mikolaj Golub wrote: >=20 > > If we agree to have only the new behavior then nullfs won't need modifi= cation > > at all, it will work as expected automatically. The patch could be (wit= h updated > > locking for the connect case): > >=20 > > http://people.freebsd.org/~trociny/VOP_UNP.1.patch >=20 > Greatly simplified. >=20 > > --- sys/kern/uipc_usrreq.c (revision 229979) > > +++ sys/kern/uipc_usrreq.c (working copy) > > @@ -542,7 +542,7 @@ > > =20 > > UNP_LINK_WLOCK(); > > UNP_PCB_LOCK(unp); > > - vp->v_socket =3D unp->unp_socket; > > + VOP_UNPBIND(vp, unp->unp_socket); > > unp->unp_vnode =3D vp; > > unp->unp_addr =3D soun; > > unp->unp_flags &=3D ~UNP_BINDING; >=20 >=20 > I still find myself worried by the fact that unp->unp_vnode points at the= nullfs vnode rather than the underlying vnode, but haven't yet managed to = identify any actual bugs that would result. I'll continue pondering it over= the weekend :-). I think I know what could go wrong there, but due to other bug, this wrongness cannot be realized now. Issue is that for the forced unmount, the unp_vnode is reclaimed, so that the unix domain sockets code references freed memory after reclaim. Probably, some helper should provided by uipc_usrreq, called from VOP_RECLA= IM() implementations for VSOCK types of vnodes. --hS91mLTIjizZlFCb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8PVcoACgkQC3+MBN1Mb4jTlACgr2ba8j+s+1oezEf3Azb44vo4 I2wAoN++39PDxWynxcWOH9bktOstdrTv =DDZw -----END PGP SIGNATURE----- --hS91mLTIjizZlFCb--