1
0
Fork 0

scsi: ips: Use correct command completion on error

A non-zero queuecommand() return code means 'busy', i.e. the command hasn't
been submitted. So any command which should be failed need to be completed
via the ->scsi_done() callback with the appropriate result code set.

Link: https://lore.kernel.org/r/20210113090500.129644-32-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
master
Hannes Reinecke 2021-01-13 10:04:56 +01:00 committed by Martin K. Petersen
parent fc8e006c38
commit 88188179f3
1 changed files with 7 additions and 2 deletions

View File

@ -1045,10 +1045,10 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)
ha = (ips_ha_t *) SC->device->host->hostdata;
if (!ha)
return (1);
goto out_error;
if (!ha->active)
return (DID_ERROR);
goto out_error;
if (ips_is_passthru(SC)) {
if (ha->copp_waitlist.count == IPS_MAX_IOCTL_QUEUE) {
@ -1123,6 +1123,11 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)
ips_next(ha, IPS_INTR_IORL);
return (0);
out_error:
SC->result = DID_ERROR << 16;
done(SC);
return (0);
}