diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2014-07-03 11:18:14 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-25 17:16:59 -0400 |
commit | 3fa89a04e064e586df4ed3208a8e62012a65b17f (patch) | |
tree | 4786ffffea110d97e273c46680f85063cbf7accb /drivers/scsi/hpsa.c | |
parent | 2a5ac32653786871f03a22ecd524617cf53e1b53 (diff) |
hpsa: fix 6-byte READ/WRITE with 0 length data xfer
a 6-byte READ/WRITE CDB with a 0 block data transfer really
means a 256 block data transfer. The RAID mapping code failed
to handle this case. For 10/12/16 byte READ/WRITEs, 0 just means
no data should be transferred, and should not trigger BUG_ON.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r-- | drivers/scsi/hpsa.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 1d284730d66b..6edd2aaacbab 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -3686,6 +3686,8 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h, | |||
3686 | (((u64) cmd->cmnd[2]) << 8) | | 3686 | (((u64) cmd->cmnd[2]) << 8) | |
3687 | cmd->cmnd[3]; | 3687 | cmd->cmnd[3]; |
3688 | block_cnt = cmd->cmnd[4]; | 3688 | block_cnt = cmd->cmnd[4]; |
3689 | if (block_cnt == 0) | ||
3690 | block_cnt = 256; | ||
3689 | break; | 3691 | break; |
3690 | case WRITE_10: | 3692 | case WRITE_10: |
3691 | is_write = 1; | 3693 | is_write = 1; |
@@ -3734,7 +3736,6 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h, | |||
3734 | default: | 3736 | default: |
3735 | return IO_ACCEL_INELIGIBLE; /* process via normal I/O path */ | 3737 | return IO_ACCEL_INELIGIBLE; /* process via normal I/O path */ |
3736 | } | 3738 | } |
3737 | BUG_ON(block_cnt == 0); | ||
3738 | last_block = first_block + block_cnt - 1; | 3739 | last_block = first_block + block_cnt - 1; |
3739 | 3740 | ||
3740 | /* check for write to non-RAID-0 */ | 3741 | /* check for write to non-RAID-0 */ |