【sas-1130】scsi: sd: define variable dif as unsigned int instead of bool

Bug #1854547 reported by Fred Kimmy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kunpeng920
Fix Released
Undecided
Unassigned
Ubuntu-18.04
Invalid
Undecided
Unassigned
Ubuntu-18.04-hwe
Fix Released
Undecided
Unassigned
Ubuntu-19.04
Invalid
Undecided
Unassigned
Ubuntu-19.10
Fix Released
Undecided
Ike Panhc
Ubuntu-20.04
Fix Released
Undecided
Unassigned
Upstream-kernel
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Eoan
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

[Bug Description]
DIF3 WILL not work when run fio test

【Steps to Reproduce]
1. Enable DIF/DIX for DIF3 disk
2. fio test

[Actual Results]
IO error when running IO;
[ 781.032816] sd 5:0:0:0: [sdd] Disabling DIF Type 3 protection
[ 781.112250] sd 5:0:0:0: [sdd] tag#72 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.112287] sd 5:0:0:0: [sdd] tag#72 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.112305] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.118429] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.204243] sd 5:0:0:0: [sdd] tag#77 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.204252] sd 5:0:0:0: [sdd] tag#77 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.204257] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.210365] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.296238] sd 5:0:0:0: [sdd] tag#82 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.296266] sd 5:0:0:0: [sdd] tag#82 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.296276] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.302384] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.309207] ldm_validate_partition_table(): Disk read failed.
[ 781.392239] sd 5:0:0:0: [sdd] tag#87 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.392267] sd 5:0:0:0: [sdd] tag#87 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.392278] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.398386] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.484250] sd 5:0:0:0: [sdd] tag#92 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.484260] sd 5:0:0:0: [sdd] tag#92 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.484264] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.490371] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.576249] sd 5:0:0:0: [sdd] tag#97 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.576278] sd 5:0:0:0: [sdd] tag#97 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.576293] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.582399] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.668236] sd 5:0:0:0: [sdd] tag#102 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.668245] sd 5:0:0:0: [sdd] tag#102 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.668249] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.674354] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.681184] Dev sdd: unable to read RDB block 0
[ 781.764241] sd 5:0:0:0: [sdd] tag#121 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.764267] sd 5:0:0:0: [sdd] tag#121 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.764278] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.770386] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.856240] sd 5:0:0:0: [sdd] tag#126 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.856248] sd 5:0:0:0: [sdd] tag#126 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 781.856253] print_req_error: I/O error, dev sdd, sector 0 flags 0
[ 781.862362] Buffer I/O error on dev sdd, logical block 0, async page read
[ 781.948238] sd 5:0:0:0: [sdd] tag#131 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 781.948264] sd 5:0:0:0: [sdd] tag#131 CDB: Read(10) 28 00 00 00 00 18 00 00 08 00
[ 781.948272] print_req_error: I/O error, dev sdd, sector 24 flags 0
[ 781.954467] Buffer I/O error on dev sdd, logical block 3, async page read
[ 782.120252] sdd: unable to read partition table

[Expected Results]
IO running normally

[Reproducibility]
occasionally

[Additional information]
Hardware: D06 CS
Firmware: NA+I59
Kernel: NA

[Resolution]
Variable dif in function sd_setup_read_write_cmnd() is the return value of
function scsi_host_dif_capable() which returns dif capability of disks. If
define it as bool, even for the disks which support DIF3, the function
still return dif=1, which causes IO error. So define variable dif as
unsigned int instead of bool.

scsi: sd: define variable dif as unsigned int instead of bool

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

This is a fix for an issue introduced in v5.4, so it should not apply to older releases.

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

This patch fixes e249e42d277e ("scsi: sd: Clean up sd_setup_read_write_cmnd()") which being introduced since 5.1 and can be clean cherry-picked to 5.3.

Ike Panhc (ikepanhc)
Changed in linux (Ubuntu Focal):
status: New → Confirmed
Changed in linux (Ubuntu Eoan):
assignee: nobody → Ike Panhc (ikepanhc)
status: New → In Progress
Revision history for this message
Ike Panhc (ikepanhc) wrote :

Already in Eoan kernel through 5.3.11 stable release. Currently in eoan-proposed and linux-hwe in bionic-proposed. Expected to hit -update on Jan-6th.

Changed in linux (Ubuntu Eoan):
assignee: Ike Panhc (ikepanhc) → nobody
status: In Progress → Fix Committed
Changed in kunpeng920:
status: Triaged → Fix Committed
Revision history for this message
Ike Panhc (ikepanhc) wrote :

In focal-proposed too.

Changed in linux (Ubuntu Focal):
status: Confirmed → Fix Committed
Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

18.04.4 is now released.

Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

Picked up through the stable channel, so the kernel bot didn't update the status.

Changed in linux (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

Already in 5.4 kernel through stable channel.

Changed in linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Ike Panhc (ikepanhc)
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.