[scsi-0121]scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI

Bug #1860397 reported by Fred Kimmy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kunpeng920
Fix Released
Undecided
dann frazier
Ubuntu-18.04
Fix Released
Undecided
dann frazier
Ubuntu-18.04-hwe
Fix Released
Undecided
dann frazier
Ubuntu-20.04
Fix Released
Undecided
dann frazier
Upstream-kernel
Fix Released
Undecided
Unassigned

Bug Description

[Bug Description]
If an attached disk with protection information enabled is reformatted
to Type 0 the revalidation code does not clear the original protection
type and subsequent accesses will keep setting RDPROTECT/WRPROTECT.

Set the protection type to 0 if the disk reports PROT_EN=0 in READ
CAPACITY(16).

[Steps to Reproduce]
1.Format a SAS disk as DIF disk;
2.insmod SAS with DIF/DIX enable;
3. Format the DIF disk as a normal disk;

[Actual Results]
IO error occurs;

[Expected Results]
Without exception

[Reproducibility]
Inevitably

[Additional information]
Hardware: D06
Firmware: NA
Kernel: NA

[Resolution]
Set the protection type to 0 if the disk reports PROT_EN=0 in READ
CAPACITY(16).

scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI

Revision history for this message
dann frazier (dannf) wrote :

This patch is queued for stable, so should normally flow into all supported streams.

Changed in kunpeng920:
status: New → Triaged
dann frazier (dannf)
Changed in kunpeng920:
assignee: nobody → dann frazier (dannf)
Revision history for this message
Ike Panhc (ikepanhc) wrote :

In focal kernel since 5.4.0-13.16

Revision history for this message
Ike Panhc (ikepanhc) wrote :

In bionic kernel since 4.15.0-89.89

Changed in kunpeng920:
status: Triaged → Fix Committed
Revision history for this message
Ike Panhc (ikepanhc) wrote :

In HWE 5.3 kernel already.

Changed in kunpeng920:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.