diff options
author | Hugh Dickins <hugh@veritas.com> | 2008-08-06 13:21:18 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-08-06 13:49:23 -0400 |
commit | d211f052fa58a053639bc51501cb64421157d362 (patch) | |
tree | 8850e9490295e2697ecfd3ec72729a867b376d65 /include/scsi | |
parent | 0967d61ea0d8e8a7826bd8949cd93dd1e829ac55 (diff) |
[SCSI] sd: fix USB devices incorrectly reporting DIF support
Some USB devices set the protect bit in the INQUIRY data which
currently causes the DIF code in sd to assume (incorrectly) that they
support READ_CAPACITY(16). Fix this (only for the time being) by
making sure we only believe the protect bit in the inquiry data if the
device claims conformance to SCSI-3 or above.
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_device.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 291d56a19167..80b2e93c2936 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/workqueue.h> | 7 | #include <linux/workqueue.h> |
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <scsi/scsi.h> | ||
9 | #include <asm/atomic.h> | 10 | #include <asm/atomic.h> |
10 | 11 | ||
11 | struct request_queue; | 12 | struct request_queue; |
@@ -426,7 +427,7 @@ static inline int scsi_device_enclosure(struct scsi_device *sdev) | |||
426 | 427 | ||
427 | static inline int scsi_device_protection(struct scsi_device *sdev) | 428 | static inline int scsi_device_protection(struct scsi_device *sdev) |
428 | { | 429 | { |
429 | return sdev->inquiry[5] & (1<<0); | 430 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); |
430 | } | 431 | } |
431 | 432 | ||
432 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ | 433 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ |