Use the sense data in the dm-mpath hardware handlers. Signed-off-by: Lars Marowsky-Bree Index: linux-2.6.18-rc7/drivers/md/dm-emc.c =================================================================== --- linux-2.6.18-rc7.orig/drivers/md/dm-emc.c 2006-09-14 22:32:11.000000000 +0100 +++ linux-2.6.18-rc7/drivers/md/dm-emc.c 2006-10-13 17:10:39.000000000 +0100 @@ -288,12 +288,10 @@ static void emc_destroy(struct hw_handle static unsigned emc_error(struct hw_handler *hwh, struct bio *bio) { - /* FIXME: Patch from axboe still missing */ -#if 0 int sense; - if (bio->bi_error & BIO_SENSE) { - sense = bio->bi_error & 0xffffff; /* sense key / asc / ascq */ + if (bio_sense_valid(bio)) { + sense = bio_sense_value(bio); /* sense key / asc / ascq */ if (sense == 0x020403) { /* LUN Not Ready - Manual Intervention Required @@ -304,21 +302,20 @@ static unsigned emc_error(struct hw_hand * progress, we should set FAIL_PATH too. * This indicates we might have to do a SCSI * inquiry in the end_io path. Ugh. */ - return MP_BYPASS_PG | MP_RETRY_IO; + return MP_BYPASS_PG; } else if (sense == 0x052501) { /* An array based copy is in progress. Do not * fail the path, do not bypass to another PG, * do not retry. Fail the IO immediately. * (Actually this is the same conclusion as in * the default handler, but lets make sure.) */ - return 0; + return MP_ERROR_IO; } else if (sense == 0x062900) { /* Unit Attention Code. This is the first IO * to the new path, so just retry. */ - return MP_RETRY_IO; + return 0; } } -#endif /* Try default handler */ return dm_scsi_err_handler(hwh, bio); Index: linux-2.6.18-rc7/drivers/md/dm-hw-handler.c =================================================================== --- linux-2.6.18-rc7.orig/drivers/md/dm-hw-handler.c 2006-09-14 22:32:11.000000000 +0100 +++ linux-2.6.18-rc7/drivers/md/dm-hw-handler.c 2006-10-13 17:10:39.000000000 +0100 @@ -150,15 +150,14 @@ int dm_unregister_hw_handler(struct hw_h unsigned dm_scsi_err_handler(struct hw_handler *hwh, struct bio *bio) { -#if 0 int sense_key, asc, ascq; - if (bio->bi_error & BIO_SENSE) { + if (bio_sense_valid(bio)) { /* FIXME: This is just an initial guess. */ /* key / asc / ascq */ - sense_key = (bio->bi_error >> 16) & 0xff; - asc = (bio->bi_error >> 8) & 0xff; - ascq = bio->bi_error & 0xff; + sense_key = (bio_sense_value(bio) >> 16) & 0xff; + asc = (bio_sense_value(bio) >> 8) & 0xff; + ascq = bio_sense_value(bio) & 0xff; switch (sense_key) { /* This block as a whole comes from the device. @@ -203,7 +202,6 @@ unsigned dm_scsi_err_handler(struct hw_h return 0; } } -#endif /* We got no idea how to decode the other kinds of errors -> * assume generic error condition. */