changeset 9904:d260bd3fd47c

6838344 kernel heap corruption detected on zil while stress testing
author Neil Perrin <Neil.Perrin@Sun.COM>
date Thu, 18 Jun 2009 21:41:20 -0600
parents 32d4b092c572
children 6ec9863bc3c6
files usr/src/uts/common/fs/zfs/zil.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/zfs/zil.c	Thu Jun 18 17:55:57 2009 -0700
+++ b/usr/src/uts/common/fs/zfs/zil.c	Thu Jun 18 21:41:20 2009 -0600
@@ -714,14 +714,15 @@
 	lwb->lwb_buf = NULL;
 	if (zio->io_error)
 		zilog->zl_log_error = B_TRUE;
-	mutex_exit(&zilog->zl_lock);
 
 	/*
 	 * Now that we've written this log block, we have a stable pointer
 	 * to the next block in the chain, so it's OK to let the txg in
-	 * which we allocated the next block sync.
+	 * which we allocated the next block sync. We still have the
+	 * zl_lock to ensure zil_sync doesn't kmem free the lwb.
 	 */
 	txg_rele_to_sync(&lwb->lwb_txgh);
+	mutex_exit(&zilog->zl_lock);
 }
 
 /*