scsi: iscsi: Fix offload conn cleanup when iscsid restarts
authorMike Christie <michael.christie@oracle.com>
Fri, 8 Apr 2022 00:13:06 +0000 (19:13 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 12 Apr 2022 02:09:34 +0000 (22:09 -0400)
commitcbd2283aaf47fef4ded4b29124b1ef3beb515f3a
treea9c94a6b492a5ba1702228d66f0eb5a26fec5c94
parentc34f95e98d8fb750eefd4f3fe58b4f8b5e89253b
scsi: iscsi: Fix offload conn cleanup when iscsid restarts

When userspace restarts during boot or upgrades it won't know about the
offload driver's endpoint and connection mappings. iscsid will start by
cleaning up the old session by doing a stop_conn call. Later, if we are
able to create a new connection, we clean up the old endpoint during the
binding stage. The problem is that if we do stop_conn before doing the
ep_disconnect call offload, drivers can still be executing I/O. We then
might free tasks from the under the card/driver.

This moves the ep_disconnect call to before we do the stop_conn call for
this case. It will then work and look like a normal recovery/cleanup
procedure from the driver's point of view.

Link: https://lore.kernel.org/r/20220408001314.5014-3-michael.christie@oracle.com
Tested-by: Manish Rangankar <mrangankar@marvell.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_transport_iscsi.c