Date: Thu, 12 Jan 2012 23:51:06 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: "Robert N. M. Watson" <rwatson@freebsd.org> Cc: Mikolaj Golub <trociny@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: unix domain sockets on nullfs(5) Message-ID: <20120112215106.GC31224@deviant.kiev.zoral.com.ua> In-Reply-To: <BBDE763A-F55E-453D-A503-2489C9040EF6@freebsd.org> References: <86sjjobzmn.fsf@kopusha.home.net> <D1B8F00C-1E0D-4916-BD4B-FBCAE28E6F22@FreeBSD.org> <86fwfnti5t.fsf@kopusha.home.net> <CAOnPXZ_y5G6uEBWmfuH7qYBh%2B4Pw=O91ztCPEFCOTzWdCzx%2BRA@mail.gmail.com> <BBDE763A-F55E-453D-A503-2489C9040EF6@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120112215106.GC31224>