Skip to contentSkip to conversation

cciss: fix handling of protocol error

PATCH In review Stephen M. Cameron 2 participants 2 messages Sep 14, 2012 – Sep 18, 2012 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cciss: fix handling of protocol error

From: Stephen M. Cameron <[email protected]>

If a command completes with a status of CMD_PROTOCOL_ERR, this information should be conveyed to the SCSI mid layer, not dropped on the floor. Unlike a similar bug in the hpsa driver, this bug only affects tape drives and CD and DVD ROM drives in the cciss driver, and to induce it, you have to disconnect (or damage) a cable, so it is not a very likely scenario (which would explain why the bug has gone undetected for the last 10 years.)

---
 drivers/block/cciss_scsi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/block/cciss_scsi.c +1 -0
index 38aa6dd..da33111 100644
@@ -795,6 +795,7 @@ static void complete_scsi_command(CommandList_struct *c, int timeout,
 				}
 			break;
 			case CMD_PROTOCOL_ERR:
+				cmd->result = DID_ERROR << 16;
 				dev_warn(&h->pdev->dev,
 					"%p has protocol error\n", c);
                         break;
maintainer
#1 lore raw
Quoted 9 lines · Stephen M. Cameron

From: Stephen M. Cameron <[email protected]>

If a command completes with a status of CMD_PROTOCOL_ERR, this information should be conveyed to the SCSI mid layer, not dropped on the floor. Unlike a similar bug in the hpsa driver, this bug only affects tape drives and CD and DVD ROM drives in the cciss driver, and to induce it, you have to disconnect (or damage) a cable, so it is not a very likely scenario (which would explain why the bug has gone undetected for the last 10 years.)

Thanks Stephen, applied.

Signature · 1 line
Jens Axboe