Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Feb 2009 11:19:02 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r189163 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb geom
Message-ID:  <200902281119.n1SBJ2wU007529@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sat Feb 28 11:19:02 2009
New Revision: 189163
URL: http://svn.freebsd.org/changeset/base/189163

Log:
  MFC r187053:
  
  Prevent a panic that happens on SMP machines when removing a disk with
  many writes queued up.
  
  Reviewed by:	phk, scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/geom/geom_vfs.c

Modified: stable/7/sys/geom/geom_vfs.c
==============================================================================
--- stable/7/sys/geom/geom_vfs.c	Sat Feb 28 11:16:57 2009	(r189162)
+++ stable/7/sys/geom/geom_vfs.c	Sat Feb 28 11:19:02 2009	(r189163)
@@ -71,6 +71,16 @@ g_vfs_done(struct bio *bip)
 	struct buf *bp;
 	int vfslocked;
 
+	/*
+	 * Provider ('bio_to') could have withered away sometime
+	 * between incrementing the 'nend' in g_io_deliver() and now,
+	 * making 'bio_to' a dangling pointer.  We cannot do that
+	 * in g_wither_geom(), as it would require going over
+	 * the 'g_bio_run_up' list, resetting the pointer.
+	 */
+	if (bip->bio_from->provider == NULL)
+		bip->bio_to = NULL;
+
 	if (bip->bio_error) {
 		printf("g_vfs_done():");
 		g_print_bio(bip);
@@ -136,7 +146,7 @@ g_vfs_orphan(struct g_consumer *cp)
 	g_detach(cp);
 
 	/*
-	 * Do not destroy the geom. Filesystem will do this during unmount.
+	 * Do not destroy the geom.  Filesystem will do that during unmount.
 	 */
 }
 



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