]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: sd: define variable dif as unsigned int instead of bool
authorXiang Chen <chenxiang66@hisilicon.com>
Tue, 22 Oct 2019 06:27:08 +0000 (14:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2019 18:27:55 +0000 (19:27 +0100)
commit37d4de65b10959894411fff6e8d3fbc9f4abc150
treea3e34aa9e7f6c9d15d376e3d09bd269beeaa753d
parent9b414f0c95f08e3c1e8193f31a1a5c6f94f661c2
scsi: sd: define variable dif as unsigned int instead of bool

[ Upstream commit 0cf9f4e547cebb5f5d2d046437c71ddcc8ea4a39 ]

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.

Fixes: e249e42d277e ("scsi: sd: Clean up sd_setup_read_write_cmnd()")
Link: https://lore.kernel.org/r/1571725628-132736-1-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/sd.c