All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: Omar Sandoval <osandov@osandov.com>
Cc: linux-block@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 1/2] blk-mq: fix leak of q->stats
Date: Tue, 28 Mar 2017 10:43:54 +0800	[thread overview]
Message-ID: <20170328024351.GA23217@ming.t460p> (raw)
In-Reply-To: <de751892a392533e8e26fffbf72ba7904cfda468.1490636543.git.osandov@fb.com>

On Mon, Mar 27, 2017 at 10:43:58AM -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> blk_alloc_queue_node() already allocates q->stats, so
> blk_mq_init_allocated_queue() is overwriting it with a new allocation.
> 
> Fixes: a83b576c9c25 ("block: fix stacked driver stats init and free")
> Signed-off-by: Omar Sandoval <osandov@fb.com>
> ---
>  block/blk-mq.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index c212b9644a9f..9c6b39bd8358 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -2212,10 +2212,6 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
>  	/* mark the queue as mq asap */
>  	q->mq_ops = set->ops;
>  
> -	q->stats = blk_alloc_queue_stats();
> -	if (!q->stats)
> -		goto err_exit;
> -
>  	q->poll_cb = blk_stat_alloc_callback(blk_mq_poll_stats_fn,
>  					     blk_stat_rq_ddir, 2, q);
>  	if (!q->poll_cb)
> -- 
> 2.12.1
> 

Reviewed-by: Ming Lei <tom.leiming@gmail.com>

-- 
Ming

      parent reply	other threads:[~2017-03-28  2:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 17:43 [PATCH 1/2] blk-mq: fix leak of q->stats Omar Sandoval
2017-03-27 17:43 ` [PATCH 2/2] block: fix leak of q->rq_wb Omar Sandoval
2017-03-28  2:52   ` Omar Sandoval
2017-03-28  3:43   ` Ming Lei
2017-03-28  3:45     ` Omar Sandoval
2017-03-28  2:43 ` Ming Lei [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170328024351.GA23217@ming.t460p \
    --to=tom.leiming@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@osandov.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.