lkml.org 
[lkml]   [2013]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] block: fix mq request allocation
On 12/02/2013 08:20 AM, Jeff Moyer wrote:
> Ming Lei <tom.leiming@gmail.com> writes:
>
>> blk_mq_alloc_request_pinned() may return NULL request in case of
>> !__GFP_WAIT, so cause its callers to derefence NULL pointer for
>> releasing current context.
>>
>> This patch introduces two flags to address the issue.
>
> Hi, Ming,
>
>
> Good catch, but your patch seems overly complicated. How about
> something like the following (compile-tested only), instead? Note that
> I did not touch blk_make_request, as the put_ctx there seems to
> correlate to a get_ctx earlier in the function (not a leaked reference
> from __blk_mq_alloc_request).

I would tend to agree, it's overly complicated. The bug is real, however.

> p.s. Jens, every time I see GFP_ATOMIC|__GFP_WAIT, my head explodes. Just sayin'.

It's perfectly fine :-)

--
Jens Axboe



\
 
 \ /
  Last update: 2013-12-02 18:01    [W:0.158 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site