From owner-freebsd-emulation@FreeBSD.ORG Thu Feb 19 21:10:02 2009 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0821106566C for ; Thu, 19 Feb 2009 21:10:02 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 628AB8FC13 for ; Thu, 19 Feb 2009 21:10:02 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id C6E121D22B; Thu, 19 Feb 2009 22:10:01 +0100 (CET) Resent-From: ed@80386.nl Resent-Date: Thu, 19 Feb 2009 22:10:01 +0100 Resent-Message-ID: <20090219211001.GH19161@hoeg.nl> Resent-To: freebsd-emulation@FreeBSD.org Date: Thu, 19 Feb 2009 22:09:43 +0100 From: Ed Schouten To: Roman Divacky Message-ID: <20090219210943.GG19161@hoeg.nl> References: <20090219205645.GF19161@hoeg.nl> <20090219205653.GA78242@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B8ONY/mu/bqBak9m" Content-Disposition: inline In-Reply-To: <20090219205653.GA78242@freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Subject: Re: Making Linux stat() less evil X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 21:10:02 -0000 --B8ONY/mu/bqBak9m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Roman Divacky 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 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--