Re: usb hdd problems with 2.6.27.2

From: Alan Stern
Date: Mon Oct 27 2008 - 16:10:31 EST


On Mon, 27 Oct 2008, Luciano Rocha wrote:

> > The patches are here:
> >
> > http://marc.info/?l=linux-scsi&m=122443015406309&w=2
> >
> > They are based on 2.6.27, not 2.6.28-rc.
>
> I've tested them (on 2.6.27.4), but I still get the bug. That email mentions:
> "Neither patch addresses the infinite-retry problem; I wanted
> to keep the issues separate."
>
> So am I missing some other patch?
>
> 2.6.28-rc2 is also buggy.

Okay, I tried the same sort of experiment in 2.6.27.4 and got the same
result as you did. I was able to fix it by applying the 8bfa24727
commit mentioned earlier together with the patch below.

Now, I'm pretty sure this is not the ideal solution. Fixing the block
core would be better. Still, it does indicate for sure that there's a
real problem.

It's worth noting that the test added to scsi_requeue_command()
succeeds every time, that is, req->retries is always 0. Clearly more
work is needed.

Alan Stern



Index: 2.6.27.4/drivers/scsi/scsi_lib.c
===================================================================
--- 2.6.27.4.orig/drivers/scsi/scsi_lib.c
+++ 2.6.27.4/drivers/scsi/scsi_lib.c
@@ -611,6 +611,11 @@ static void scsi_requeue_command(struct
struct request *req = cmd->request;
unsigned long flags;

+ if (--req->retries <= 0) {
+ blk_end_request(req, -EIO, blk_rq_bytes(req));
+ scsi_next_command(cmd);
+ return;
+ }
scsi_unprep_request(req);
spin_lock_irqsave(q->queue_lock, flags);
blk_requeue_request(q, req);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/