Commit be922f47 authored by Martin K. Petersen's avatar Martin K. Petersen Committed by James Bottomley

[SCSI] sd: Always print actual protection_type

Now that we no longer use protection_type as trigger for preparing
protected CDBs we can remove the places that set it to zero.  This
allows userland to see which protection type the device is formatted
with regardless of whether the HBA supports DIF or not.
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent bd623e79
...@@ -1253,14 +1253,12 @@ void sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer) ...@@ -1253,14 +1253,12 @@ void sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer)
else else
type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */ type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */
sdkp->protection_type = type;
switch (type) { switch (type) {
case SD_DIF_TYPE0_PROTECTION: case SD_DIF_TYPE0_PROTECTION:
sdkp->protection_type = 0;
break;
case SD_DIF_TYPE1_PROTECTION: case SD_DIF_TYPE1_PROTECTION:
case SD_DIF_TYPE3_PROTECTION: case SD_DIF_TYPE3_PROTECTION:
sdkp->protection_type = type;
break; break;
case SD_DIF_TYPE2_PROTECTION: case SD_DIF_TYPE2_PROTECTION:
...@@ -1278,7 +1276,6 @@ void sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer) ...@@ -1278,7 +1276,6 @@ void sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer)
return; return;
disable: disable:
sdkp->protection_type = 0;
sdkp->capacity = 0; sdkp->capacity = 0;
} }
......
...@@ -321,7 +321,6 @@ void sd_dif_config_host(struct scsi_disk *sdkp) ...@@ -321,7 +321,6 @@ void sd_dif_config_host(struct scsi_disk *sdkp)
if (scsi_host_dif_capable(sdp->host, type) == 0) { if (scsi_host_dif_capable(sdp->host, type) == 0) {
sd_printk(KERN_INFO, sdkp, "Type %d protection " \ sd_printk(KERN_INFO, sdkp, "Type %d protection " \
"unsupported by HBA. Disabling DIF.\n", type); "unsupported by HBA. Disabling DIF.\n", type);
sdkp->protection_type = 0;
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment