]> git.baikalelectronics.ru Git - kernel.git/commit
target: Fix compare_and_write_callback handling for non GOOD status
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 11 Apr 2017 23:24:16 +0000 (16:24 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 5 May 2017 03:01:39 +0000 (20:01 -0700)
commitcafcffa8fd3c2daff99075f848df073e66291581
treeade47401f759e833d0b74849049882c815a51003
parent0def555b6dd061ca71a9770068e37ef25c8f3158
target: Fix compare_and_write_callback handling for non GOOD status

Following the bugfix for handling non SAM_STAT_GOOD COMPARE_AND_WRITE
status during COMMIT phase in commit 9587eebb289, the same bug exists
for the READ phase as well.

This would manifest first as a lost SCSI response, and eventual
hung task during fabric driver logout or re-login, as existing
shutdown logic waited for the COMPARE_AND_WRITE se_cmd->cmd_kref
to reach zero.

To address this bug, compare_and_write_callback() has been changed
to set post_ret = 1 and return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE
as necessary to signal failure status.

Reported-by: Bill Borsari <wgb@datera.io>
Cc: Bill Borsari <wgb@datera.io>
Tested-by: Gary Guo <ghg@datera.io>
Cc: Gary Guo <ghg@datera.io>
Cc: <stable@vger.kernel.org> # v4.1+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_sbc.c