public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix id computation in scsi_eh_target_reset()
@ 2010-10-14 14:04 Hillf Danton
  2010-10-18  5:33 ` Mike Christie
  0 siblings, 1 reply; 14+ messages in thread
From: Hillf Danton @ 2010-10-14 14:04 UTC (permalink / raw)
  To: linux-scsi

There seems that the id of the tgtr_scmd processed by
scsi_try_target_reset() does not match the id in case that
SUCCESS is returned by scsi_try_target_reset().

The mismatch is fixed, and the loop to find the next highest
is also simplified.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- a/drivers/scsi/scsi_error.c	2010-09-13 07:07:38.000000000 +0800
+++ b/drivers/scsi/scsi_error.c	2010-10-14 21:45:56.000000000 +0800
@@ -1173,14 +1173,19 @@ static int scsi_eh_target_reset(struct S
 			list_for_each_entry(scmd, work_q, eh_entry) {
 				if (scmd_id(scmd) > id &&
 				    (!tgtr_scmd ||
-				     scmd_id(tgtr_scmd) > scmd_id(scmd)))
+				     scmd_id(tgtr_scmd) > scmd_id(scmd))) {
 						tgtr_scmd = scmd;
+						if (1 + id == scmd_id(scmd))
+							break;
+				}
 			}
 		}
 		if (!tgtr_scmd)
 			/* no more commands, that's it */
 			break;

+		id = scmd_id(tgtr_scmd);
+
 		SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Sending target reset "
 						  "to target %d\n",
 						  current->comm, id));

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-12-16 15:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-14 14:04 [PATCH] fix id computation in scsi_eh_target_reset() Hillf Danton
2010-10-18  5:33 ` Mike Christie
2010-10-25 20:53   ` James Bottomley
2010-10-26 14:04     ` Hillf Danton
2010-10-26 20:13       ` Mike Christie
2010-10-26 20:10         ` James Bottomley
2010-10-27 13:12         ` Hillf Danton
2010-10-26 23:07     ` Mike Christie
2010-10-26 23:09       ` James Bottomley
2010-10-27 18:18         ` Mike Christie
2010-10-28 13:29           ` Hillf Danton
2010-12-14 20:57           ` Mike Christie
2010-12-15  2:31             ` James Bottomley
2010-12-16 15:10             ` Hillf Danton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox