]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 May 2017 12:30:55 +0000 (14:30 +0200)
commitf78392c0160c418dd88d45591686a8e527dfd868
tree0d7f99c3aa042a460a3508bf07595668c971f7d6
parent8fe6ee0b6e695b8e5de802c9d0a1360493653ee8
target: Fix compare_and_write_callback handling for non GOOD status

commit a71a5dc7f833943998e97ca8fa6a4c708a0ed1a9 upstream.

Following the bugfix for handling non SAM_STAT_GOOD COMPARE_AND_WRITE
status during COMMIT phase in commit 9b2792c3da1, 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>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_sbc.c