Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fd046f9 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by James Bottomley
Browse files

[SCSI] scsi_error: Escalate to LUN reset if abort fails



If a command abort fails there is a fair chance that all other
aborts will be failing, too.
So we should be calling LUN reset directly after the first failed
abort and skip aborting the remaining commands.

Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent b4562022
Loading
Loading
Loading
Loading
+9 −7
Original line number Original line Diff line number Diff line
@@ -1192,18 +1192,20 @@ static int scsi_eh_abort_cmds(struct list_head *work_q,
						  "0x%p\n", current->comm,
						  "0x%p\n", current->comm,
						  scmd));
						  scmd));
		rtn = scsi_try_to_abort_cmd(shost->hostt, scmd);
		rtn = scsi_try_to_abort_cmd(shost->hostt, scmd);
		if (rtn == SUCCESS || rtn == FAST_IO_FAIL) {
		if (rtn == FAILED) {
			scmd->eh_eflags &= ~SCSI_EH_CANCEL_CMD;
			if (rtn == FAST_IO_FAIL)
				scsi_eh_finish_cmd(scmd, done_q);
			else
				list_move_tail(&scmd->eh_entry, &check_list);
		} else
			SCSI_LOG_ERROR_RECOVERY(3, printk("%s: aborting"
			SCSI_LOG_ERROR_RECOVERY(3, printk("%s: aborting"
							  " cmd failed:"
							  " cmd failed:"
							  "0x%p\n",
							  "0x%p\n",
							  current->comm,
							  current->comm,
							  scmd));
							  scmd));
			list_splice_init(&check_list, work_q);
			return list_empty(work_q);
		}
		scmd->eh_eflags &= ~SCSI_EH_CANCEL_CMD;
		if (rtn == FAST_IO_FAIL)
			scsi_eh_finish_cmd(scmd, done_q);
		else
			list_move_tail(&scmd->eh_entry, &check_list);
	}
	}


	return scsi_eh_test_devices(&check_list, work_q, done_q, 0);
	return scsi_eh_test_devices(&check_list, work_q, done_q, 0);