diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2009-01-04 03:04:34 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-01-05 10:06:23 -0500 |
commit | 5db524bd469290212781e1cb0293b57a7a1c000a (patch) | |
tree | 04f26ae6eaab0507efba49a5a30b43e29149b0b6 /drivers/scsi | |
parent | becce74b8231f8b5e51165e797f6c950d1dbcf67 (diff) |
[SCSI] sd: Correctly handle 6-byte commands with DIX
DIF does not work with 6-byte commands so we previously ignored those
commands when preparing a request. However, DIX does not need
RDPROTECT/WRPROTECT to be set and 6-byte commands are consequently
perfectly valid in host-only mode.
This patch fixes a problem where we would set the wrong DIX operation
when issuing commands to a legacy disk.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/sd_dif.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c index c9b41077fca1..184dff492797 100644 --- a/drivers/scsi/sd_dif.c +++ b/drivers/scsi/sd_dif.c | |||
@@ -374,7 +374,10 @@ void sd_dif_op(struct scsi_cmnd *scmd, unsigned int dif, unsigned int dix, unsig | |||
374 | else | 374 | else |
375 | csum_convert = 0; | 375 | csum_convert = 0; |
376 | 376 | ||
377 | BUG_ON(dif && (scmd->cmnd[0] == READ_6 || scmd->cmnd[0] == WRITE_6)); | ||
378 | |||
377 | switch (scmd->cmnd[0]) { | 379 | switch (scmd->cmnd[0]) { |
380 | case READ_6: | ||
378 | case READ_10: | 381 | case READ_10: |
379 | case READ_12: | 382 | case READ_12: |
380 | case READ_16: | 383 | case READ_16: |
@@ -390,6 +393,7 @@ void sd_dif_op(struct scsi_cmnd *scmd, unsigned int dif, unsigned int dix, unsig | |||
390 | 393 | ||
391 | break; | 394 | break; |
392 | 395 | ||
396 | case WRITE_6: | ||
393 | case WRITE_10: | 397 | case WRITE_10: |
394 | case WRITE_12: | 398 | case WRITE_12: |
395 | case WRITE_16: | 399 | case WRITE_16: |