scsi: target: iscsi: Handle abort for WRITE_PENDING cmds
authorDmitry Bogdanov <d.bogdanov@yadro.com>
Sun, 19 Mar 2023 01:56:20 +0000 (20:56 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 24 Mar 2023 21:32:23 +0000 (17:32 -0400)
commitea87981a0ee8fb8ced1c87d004a541b60623ff97
treec8d116360f713a4db6475bfe3f5b9044fc372d66
parentcc79da306ebb2edb700c3816b90219223182ac3c
scsi: target: iscsi: Handle abort for WRITE_PENDING cmds

Sometimes an initiator does not send data for a WRITE command and tries to
abort it. The abort hangs waiting for frontend driver completion. iSCSI
driver waits for data and that timeout eventually initiates connection
reinstatment. The connection closing releases the commands in the
connection, but those aborted commands still did not handle the abort and
did not decrease a command ref counter. Because of that the connection
reinstatement hangs indefinitely and prevents re-login for that initiator.

Add handling in TCM of the abort for the WRITE_PENDING commands at
connection closing moment to make it possible to release them.

Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
[mnc: Rebase and expand comment]
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20230319015620.96006-10-michael.christie@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/iscsi/iscsi_target.c