OSDN Git Service

scsi: t10-pi: Return correct ref tag when queue has no integrity profile
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 5 Dec 2018 01:58:33 +0000 (20:58 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Dec 2018 12:37:55 +0000 (13:37 +0100)
commit690699b271858d45587c868c5166cb6d495a953f
tree4f938a92f6185ff2cd6df01b00a150142810d289
parent0736458856868c920079f42a1e881d271e201390
scsi: t10-pi: Return correct ref tag when queue has no integrity profile

commit 60a89a3ce0cce515dc663bc1b45ac89202ad6c79 upstream.

Commit ddd0bc756983 ("block: move ref_tag calculation func to the block
layer") moved ref tag calculation from SCSI to a library function. However,
this change broke returning the correct ref tag for devices operating in
DIF mode since these do not have an associated block integrity profile.
This in turn caused read/write failures on PI-formatted disks attached to
an mpt3sas controller.

Fixes: ddd0bc756983 ("block: move ref_tag calculation func to the block layer")
Cc: stable@vger.kernel.org # 4.19+
Reported-by: John Garry <john.garry@huawei.com>
Tested-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/t10-pi.h