Skip site navigation (1)Skip section navigation (2)
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>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
* Roman Divacky <rdivacky@FreeBSD.org> wrote:
> why cant you use kern_statat() and perform this after it returns?
> 
> +		if (S_ISCHR(sb.st_mode) && nd.ni_vp->v_un.vu_cdev != NULL &&
> +		    linux_driver_get_major_minor(
> +		        nd.ni_vp->v_un.vu_cdev->si_name, &major, &minor) == 0) {
> +			sb.st_rdev = (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.

-- 
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkmdypcACgkQ52SDGA2eCwXsKwCfbBGIweo+V9CKFMuP0ah0gebS
p8QAnirn6bsNzu0Swce1gCLdv801KLwG
=LYhw
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090219210943.GG19161>