Date: Thu, 27 Sep 2012 20:16:25 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: "Kenneth D. Merry" <ken@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, jdp@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, phk@FreeBSD.org Subject: Re: svn commit: r240822 - head/sys/geom Message-ID: <20120927181624.GX1402@garage.freebsd.pl> In-Reply-To: <20120926194541.GB1402@garage.freebsd.pl> References: <201209221241.q8MCfnhJ067937@svn.freebsd.org> <20120925233712.GA26920@nargothrond.kdm.org> <20120926072005.GH1391@garage.freebsd.pl> <20120926172917.GA71268@nargothrond.kdm.org> <20120926185339.GA1402@garage.freebsd.pl> <20120926192117.GA89741@nargothrond.kdm.org> <20120926194541.GB1402@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
--vkJ987n7uXEPtlXE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 26, 2012 at 09:45:41PM +0200, Pawel Jakub Dawidek wrote: > On Wed, Sep 26, 2012 at 01:21:17PM -0600, Kenneth D. Merry wrote: > > Ahh. How about using LIST_FOREACH_SAFE? Would that address the proble= m at > > hand? Are there any other races in there? >=20 > It depends. If one geom can hold more than one provider then it might be > racy, but from what I see there is always only one provider - there has > to be only one, because disk_destroy() destroys it and struct disk > represents always only one disk. If that's true then I see not reason to > have a loop in there. I'd change it to: >=20 > void > disk_gone(struct disk *dp) > { > struct g_geom *gp; > struct g_provider *pp; >=20 > gp =3D dp->d_geom; > if (gp !=3D NULL) { > pp =3D LIST_FIRST(&gp->provider); > if (pp !=3D NULL) > g_wither_provider(pp, ENXIO); > } > } Final patch for review: http://people.freebsd.org/~pjd/patches/geom_disk.c.3.patch --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --vkJ987n7uXEPtlXE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBkl/gACgkQForvXbEpPzRfSQCfbgfGEZuHkyWZpWlzZwz+7A7M pZ4AnjpQ8TFfjaLRvGGJJXT0qGEiEm/O =z+cR -----END PGP SIGNATURE----- --vkJ987n7uXEPtlXE--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120927181624.GX1402>