Re: [PATCH][SCS] sd: Read Capacity if (16) fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 6 Aug 2008, James Bottomley wrote:
> On Wed, 2008-08-06 at 09:36 -0700, James Bottomley wrote:
> > On Wed, 2008-08-06 at 16:34 +0100, Hugh Dickins wrote:
> > >   PQual=0  Device_type=0  RMB=1  version=0x00  [no conformance
> > > claimed]
> > 
> > We could try using this as the trigger.  I assume all DIF supporting
> > devices must also claim conformance to SPC3/SBC2 or higher?
> 
> Just to formalise it, that would be this patch.  Hugh, could you try it?

Almost: I had to #include <scsi/scsi.h> to get SCSI_2 for the build
somewhere (and a SCSI_2 seems to be worth 1 more than anyone else's 2),
then it worked just fine for me thanks.

Hugh

p.s. sorry for losing an I from the "[SCSI]" Subject

--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -6,6 +6,7 @@
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
 #include <linux/blkdev.h>
+#include <scsi/scsi.h>
 #include <asm/atomic.h>
 
 struct request_queue;
@@ -426,7 +427,7 @@ static inline int scsi_device_enclosure(
 
 static inline int scsi_device_protection(struct scsi_device *sdev)
 {
-	return sdev->inquiry[5] & (1<<0);
+	return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0);
 }
 
 #define MODULE_ALIAS_SCSI_DEVICE(type) \
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux