changeset 11937:ee1b786b1783

6932590 zdb -vvv causes core dump
author Mark J Musante <Mark.Musante@Sun.COM>
date Tue, 16 Mar 2010 10:49:14 -0600
parents 54dc8a89ba0d
children 6f4775397a5e
files usr/src/uts/common/fs/zfs/spa_history.c usr/src/uts/common/fs/zfs/zio_inject.c
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/zfs/spa_history.c	Tue Mar 16 09:30:41 2010 -0700
+++ b/usr/src/uts/common/fs/zfs/spa_history.c	Tue Mar 16 10:49:14 2010 -0600
@@ -344,7 +344,7 @@
 	 * the first chunk of history, make sure everything has been
 	 * synced to disk so that we get it.
 	 */
-	if (*offp == 0)
+	if (*offp == 0 && spa_writeable(spa))
 		txg_wait_synced(spa_get_dsl(spa), 0);
 
 	if ((err = dmu_bonus_hold(mos, spa->spa_history, FTAG, &dbp)) != 0)
--- a/usr/src/uts/common/fs/zfs/zio_inject.c	Tue Mar 16 09:30:41 2010 -0700
+++ b/usr/src/uts/common/fs/zfs/zio_inject.c	Tue Mar 16 10:49:14 2010 -0600
@@ -239,7 +239,7 @@
 
 		if (offset < VDEV_LABEL_START_SIZE ||
 		    offset >= vd->vdev_psize - VDEV_LABEL_END_SIZE)
-		return (0);
+			return (0);
 	}
 
 	rw_enter(&inject_lock, RW_READER);