Skip to content

Commit

Permalink
[SCSI] sd: Always print actual protection_type
Browse files Browse the repository at this point in the history
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: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Oct 13, 2008
1 parent bd623e7 commit be922f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,14 +1253,12 @@ void sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer)
else
type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */

sdkp->protection_type = type;

switch (type) {
case SD_DIF_TYPE0_PROTECTION:
sdkp->protection_type = 0;
break;

case SD_DIF_TYPE1_PROTECTION:
case SD_DIF_TYPE3_PROTECTION:
sdkp->protection_type = type;
break;

case SD_DIF_TYPE2_PROTECTION:
Expand All @@ -1278,7 +1276,6 @@ void sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer)
return;

disable:
sdkp->protection_type = 0;
sdkp->capacity = 0;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/sd_dif.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ void sd_dif_config_host(struct scsi_disk *sdkp)
if (scsi_host_dif_capable(sdp->host, type) == 0) {
sd_printk(KERN_INFO, sdkp, "Type %d protection " \
"unsupported by HBA. Disabling DIF.\n", type);
sdkp->protection_type = 0;
return;
}

Expand Down

0 comments on commit be922f4

Please sign in to comment.