Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115463
b: refs/heads/master
c: c82dc88
h: refs/heads/master
i:
  115461: fcdfe1d
  115459: ef0401e
  115455: 316cdde
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Oct 13, 2008
1 parent de9be6e commit 2705848
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea2151b4e142fa2de0319d9dd80413a997bf435a
refs/heads/master: c82dc88ddaf17112841dd3a6b08352968555ee08
19 changes: 15 additions & 4 deletions trunk/drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,19 +1065,29 @@ static int scsi_eh_target_reset(struct Scsi_Host *shost,
struct list_head *done_q)
{
struct scsi_cmnd *scmd, *tgtr_scmd, *next;
unsigned int id;
unsigned int id = 0;
int rtn;

for (id = 0; id <= shost->max_id; id++) {
do {
tgtr_scmd = NULL;
list_for_each_entry(scmd, work_q, eh_entry) {
if (id == scmd_id(scmd)) {
tgtr_scmd = scmd;
break;
}
}
if (!tgtr_scmd) {
/* not one exactly equal; find the next highest */
list_for_each_entry(scmd, work_q, eh_entry) {
if (scmd_id(scmd) > id &&
(!tgtr_scmd ||
scmd_id(tgtr_scmd) > scmd_id(scmd)))
tgtr_scmd = scmd;
}
}
if (!tgtr_scmd)
continue;
/* no more commands, that's it */
break;

SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Sending target reset "
"to target %d\n",
Expand All @@ -1096,7 +1106,8 @@ static int scsi_eh_target_reset(struct Scsi_Host *shost,
" failed target: "
"%d\n",
current->comm, id));
}
id++;
} while(id != 0);

return list_empty(work_q);
}
Expand Down

0 comments on commit 2705848

Please sign in to comment.