Date: Thu, 19 Feb 2009 22:09:43 +0100 From: Ed Schouten <ed@80386.nl> To: Roman Divacky <rdivacky@FreeBSD.org> Subject: Re: Making Linux stat() less evil Message-ID: <20090219210943.GG19161@hoeg.nl> Resent-Message-ID: <20090219211001.GH19161@hoeg.nl> In-Reply-To: <20090219205653.GA78242@freebsd.org> References: <20090219205645.GF19161@hoeg.nl> <20090219205653.GA78242@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--B8ONY/mu/bqBak9m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Roman Divacky <rdivacky@FreeBSD.org> wrote: > why cant you use kern_statat() and perform this after it returns? >=20 > + if (S_ISCHR(sb.st_mode) && nd.ni_vp->v_un.vu_cdev !=3D NULL && > + linux_driver_get_major_minor( > + nd.ni_vp->v_un.vu_cdev->si_name, &major, &minor) =3D=3D 0) { > + sb.st_rdev =3D (major << 8 | minor); > + } Because I want to use the vnode used by kern_statat() directly. If we perform a second lookup after the call to kern_statat(), it's a race. There is no guarantee you're looking at the same vnode. --=20 Ed Schouten <ed@80386.nl> WWW: http://80386.nl/ --B8ONY/mu/bqBak9m Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmdypcACgkQ52SDGA2eCwXsKwCfbBGIweo+V9CKFMuP0ah0gebS p8QAnirn6bsNzu0Swce1gCLdv801KLwG =LYhw -----END PGP SIGNATURE----- --B8ONY/mu/bqBak9m--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090219210943.GG19161>