Re: [PATCH] target/spc: Set SPT correctly in Extended INQUIRY Data VPD page

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

 



On Tue, 2015-07-07 at 09:12 +0300, Sagi Grimberg wrote:
> On 7/7/2015 1:26 AM, Nicholas A. Bellinger wrote:
> > On Mon, 2015-06-29 at 18:32 +0300, Sagi Grimberg wrote:
> >> LIO supports protection types 1,3 so setting a had-coded SPT=3
> >> is fine for now.
> >>
> >> Signed-off-by: Sagi Grimberg <sagig@xxxxxxxxxxxx>
> >> ---
> >>   drivers/target/target_core_spc.c | 3 +++
> >>   1 file changed, 3 insertions(+)
> >>
> >> diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
> >> index 08114bf..aaf1964 100644
> >> --- a/drivers/target/target_core_spc.c
> >> +++ b/drivers/target/target_core_spc.c
> >> @@ -457,6 +457,9 @@ spc_emulate_evpd_86(struct se_cmd *cmd, unsigned char *buf)
> >>   			buf[4] = 0x4;
> >>   	}
> >>
> >> +	/* logical unit supports type 1 and type 3 protection */
> >> +	buf[4] |= (0x3 << 3);
> >> +
> >>   	/* Set HEADSUP, ORDSUP, SIMPSUP */
> >>   	buf[5] = 0x07;
> >>
> >
> > AFAICT this field is supposed to be reserved if INQUIRY PROTECT=0.
> >
> > How about the following to match what spc_emulate_inquiry_std() does for
> > checking when PROTECT should be set, along with an extra TYPE_DISK
> > check..?
> 
> That's fine - why the TYPE_DISK check though?
> 

According to SPC4, the SPT value is dependent on device_type:

"If the PERIPHERAL DEVICE TYPE field is set to 00h (i.e., direct access
block device) and the PROTECT bit is set to one, then table 603 defines
the contents of the SPT field."

...

"If the PERIPHERAL DEVICE TYPE field is set to 01h (i.e.,
sequential-access device) and the PROTECT bit is set to one,
then table 604 defines the contents of the SPT field."

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux