On Tue, 2008-11-04 at 20:01 -0800, bugme-daemon@xxxxxxxxxxxxxxxxxxx wrote: > http://bugzilla.kernel.org/show_bug.cgi?id=11898 > > > > > > ------- Comment #15 from alex.shi@xxxxxxxxx 2008-11-04 20:01 ------- > the fix is right. and "sdev == starved_head" does not need according code > context. so the following patch works too. > > --- scsi_lib.c.orig 2008-11-04 13:07:16.000000000 -0800 > +++ scsi_lib.c 2008-11-04 13:07:38.000000000 -0800 > @@ -607,6 +607,8 @@ > spin_unlock(sdev->request_queue->queue_lock); > > spin_lock(shost->host_lock); > + if (list_empty(&sdev->starved_entry) ) > + starved_head = NULL; > } > spin_unlock_irqrestore(shost->host_lock, flags); Actually, no. The correct patch is below. The reason for doing it like this is so that if someone slices the loop apart again (which is how this crept in) they won't get a continue or something which allows this to happen. It shouldn't be conditional on the starved list (or anything else) because it's probably a register and should happen at the same point as the list deletion but before we drop the problem lock (because once we drop that lock we'll need to recompute starvation). James --- diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f5d3b96..f9a531f 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -606,6 +606,7 @@ static void scsi_run_queue(struct request_queue *q) } list_del_init(&sdev->starved_entry); + starved_entry = NULL; spin_unlock(shost->host_lock); spin_lock(sdev->request_queue->queue_lock); -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html