lkml.org 
[lkml]   [2014]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 03/14] target/sbc: Add sbc_check_prot + update sbc_parse_cdb for DIF
From
Date
>>>>> "nab" == Nicholas A Bellinger <nab@daterainc.com> writes:

diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index 52ae54e..600ffcb 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -563,6 +563,27 @@ sbc_compare_and_write(struct se_cmd *cmd)
return TCM_NO_SENSE;
}

+bool
+sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb)
+{
+ if (!dev->dev_attrib.pi_prot_type)
+ return true;
+
+ if (dev->dev_attrib.pi_prot_type == TARGET_DIF_TYPE2_PROT &&
+ (cdb[1] & 0xe0))
+ return false;
+
+ if (!(cdb[1] & 0xe0)) {
+ pr_warn("Target: Unprotected READ/WRITE to DIF device\n");
+ return true;
+ }

You may want to remove this warning. I left it in scsi_debug upstream
for the convenience of tinkerers but quiesce it in my own tree.

--
Martin K. Petersen Oracle Linux Engineering

\
 
 \ /
  Last update: 2014-01-10 21:41    [W:0.340 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site