Re: Linux 3.0 oopses when pulling a USB CDROM

From: Alan Stern
Date: Sun Jul 03 2011 - 11:30:05 EST


On Sun, 3 Jul 2011, Andi Kleen wrote:

> > On my system, at least, the scsi_device's refcount dropped to 0 at the
> > right time. That wasn't the problem. The NULL pointer occurs because
> > the request_queue is used after the scsi_device has been removed from
> > visibility; among other things, __scsi_remove_device() sets
> > sdev->request_queue->queuedata to NULL.
> >
> > As the comment says, this causes the request function to reject all I/O
> > requests -- but not before trying to dereference the NULL pointer!
>
> Your explanation completely contradicts what James wrote earlier.

Yes, it does. I'm claiming that James was on a wrong track or looking
in the wrong direction.

> Maybe it's good if you guys come up with a common avenue of debugging
> before I try further.

It will be interesting to hear what James has to say about all this...

> > Would you like to try this patch to see if it fixes the problem? As I
> > said before, I'm not certain it's the best thing to do, but it worked
> > on my system.
>
> I can try next week.

Okay.

> Is this patch likely to fix the RCU stall?

I have no idea. All I know about this RCU stall is what you wrote
before, i.e., that it happened once. No debugging information or
anything else. However if it happens again with the patch in place,
we'll be in a good position to figure the cause and fix it.

Alan Stern

--
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/