changeset 10839:cf83b553a2ab

6836714 arc_read_done may try to byteswap undefined data
author William Gorrell <william.gorrell@sun.com>
date Thu, 22 Oct 2009 09:11:59 -0600
parents 0a1397be8bf1
children 7df556caf412
files usr/src/uts/common/fs/zfs/arc.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/zfs/arc.c	Thu Oct 22 10:04:06 2009 +0200
+++ b/usr/src/uts/common/fs/zfs/arc.c	Thu Oct 22 09:11:59 2009 -0600
@@ -2454,7 +2454,7 @@
 	/* byteswap if necessary */
 	callback_list = hdr->b_acb;
 	ASSERT(callback_list != NULL);
-	if (BP_SHOULD_BYTESWAP(zio->io_bp)) {
+	if (BP_SHOULD_BYTESWAP(zio->io_bp) && zio->io_error == 0) {
 		arc_byteswap_func_t *func = BP_GET_LEVEL(zio->io_bp) > 0 ?
 		    byteswap_uint64_array :
 		    dmu_ot[BP_GET_TYPE(zio->io_bp)].ot_byteswap;