svn commit: r240822 - head/sys/geom

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Sep 27 18:16:02 UTC 2012


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 problem at
> > hand?  Are there any other races in there?
> 
> 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:
> 
> void
> disk_gone(struct disk *dp)
> {
> 	struct g_geom *gp;
> 	struct g_provider *pp;
> 
> 	gp = dp->d_geom;
> 	if (gp != NULL) {
> 		pp = LIST_FIRST(&gp->provider);
> 		if (pp != NULL)
> 			g_wither_provider(pp, ENXIO);
> 	}
> }

Final patch for review:

	http://people.freebsd.org/~pjd/patches/geom_disk.c.3.patch

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20120927/d2eca363/attachment.pgp


More information about the svn-src-all mailing list