Re: [BUG] disk_free_ptbl_rcu_cb() crash

From: Jens Axboe
Date: Sun Oct 24 2010 - 03:06:25 EST


On 2010-10-24 08:52, Vivek Goyal wrote:
> On Sun, Oct 24, 2010 at 08:04:31AM +0200, Jens Axboe wrote:
>> On 2010-10-23 23:10, Eric Dumazet wrote:
>>> Current Linus tree makes my machine crash in disk_free_ptbl_rcu_cb(),
>>> while booting...
>>>
>>> commit 7681bfeeccff5ef seems the problem ?
>>>
>>> Following patch solves the NULL dereference, but this is only to show
>>> you where the problem is, not a real fix, of course.
>>
>> Darn. Your fix is on the right path, you missed one though. I think it's
>> cleaner to move this into the elevator helpers, so that the callers can
>> remain clean.
>>
>> Can you verify that this works too?
>
> Hi Jens,
>
> I am wondering if this fix is safe. Looking at the memstick backtrace in
> other mail thread, it looks like request queue itself has been freed. So we
> probably should be checking for request queue being valid before we try to
> check q->elevator being valid.

Looking at that trace, it's not yet deleted. But if it's in the to-free
path, by the time we invoke the rcu callback and do the quiesce end it
could be gone.

Needs a bit of thought, feel free to poke at it today if you have time
(because I really do not :-/)

I will ask Linus to revert this commit for now.

> P.S. I tried sending the same response from gmail account but it bounced.
> So if you get this mail twice, please ignore.

Didn't get it twice.

--
Jens Axboe

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