scsi: libiscsi: Fix iscsi_prep_scsi_cmd_pdu() error handling
authorMike Christie <michael.christie@oracle.com>
Sun, 7 Feb 2021 04:46:00 +0000 (22:46 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:06:25 +0000 (17:06 +0100)
commit79b4fdd8b4cfd88e0314b368bd911a732161c944
tree772fd37f6ec037c97d5d2b956979c01c975c0714
parentf49bdac3e7f4ebe195c1bf60a94164e905c2b1c9
scsi: libiscsi: Fix iscsi_prep_scsi_cmd_pdu() error handling

[ Upstream commit d28d48c699779973ab9a3bd0e5acfa112bd4fdef ]

If iscsi_prep_scsi_cmd_pdu() fails we try to add it back to the cmdqueue,
but we leave it partially setup. We don't have functions that can undo the
pdu and init task setup. We only have cleanup_task which can clean up both
parts. So this has us just fail the cmd and go through the standard cleanup
routine and then have the SCSI midlayer retry it like is done when it fails
in the queuecommand path.

Link: https://lore.kernel.org/r/20210207044608.27585-2-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/libiscsi.c