Re: [ 038/147] block: fix request_queue->flags initialization

Herton Ronaldo Krzesinski
2012-10-16T22:59:58Z

On Sun, Oct 14, 2012 at 03:36:11PM +0100, Ben Hutchings wrote:
> 3.2-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Tejun Heo <tj@kernel.org>
>
> commit 60ea8226cbd5c8301f9a39edc574ddabcb8150e0 upstream.
>
> A queue newly allocated with blk_alloc_queue_node() has only
> QUEUE_FLAG_BYPASS set. For request-based drivers,
> blk_init_allocated_queue() is called and q->queue_flags is overwritten
> with QUEUE_FLAG_DEFAULT which doesn't include BYPASS even though the
> initial bypass is still in effect.

Since QUEUE_FLAG_BYPASS doesn't exist and nothing in
blk_alloc_queue_node is set on 3.2, this change is uneeded then,
but the patch should be harmless anyway.

>
> In blk_init_allocated_queue(), or QUEUE_FLAG_DEFAULT to q->queue_flags
> instead of overwriting.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Acked-by: Vivek Goyal <vgoyal@redhat.com>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> block/blk-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 80e29c9..a17869f 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -696,7 +696,7 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
> q->request_fn = rfn;
> q->prep_rq_fn = NULL;
> q->unprep_rq_fn = NULL;
> - q->queue_flags = QUEUE_FLAG_DEFAULT;
> + q->queue_flags |= QUEUE_FLAG_DEFAULT;
>
> /* Override internal queue lock with supplied lock pointer */
> if (lock)

--
[]'s
Herton