[SCSI] sd: Ensure we correctly disable devices with unknown protection type
authorMartin K. Petersen <martin.petersen@oracle.com>
Fri, 21 Sep 2012 16:44:12 +0000 (12:44 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 24 Sep 2012 09:01:24 +0000 (13:01 +0400)
We set the capacity to zero when we discovered a device formatted with
an unknown DIF protection type. However, the read_capacity code would
override the capacity and cause the device to be enabled regardless.

Make sd_read_protection_type() return an error if the protection type is
unknown. Also prevent duplicate printk lines when the device is being
revalidated.

Reported-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

No differences found