From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754777AbbCLNv5 (ORCPT ); Thu, 12 Mar 2015 09:51:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40727 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754251AbbCLNvw (ORCPT ); Thu, 12 Mar 2015 09:51:52 -0400 Date: Thu, 12 Mar 2015 09:51:47 -0400 From: Mike Snitzer To: Ming Lei Cc: Jens Axboe , Keith Busch , Linux Kernel Mailing List , Linux SCSI List , dm-devel@redhat.com Subject: Re: [PATCH 1/7] blk-mq: fix use of incorrect goto label in blk_mq_init_queue error path Message-ID: <20150312135147.GA3444@redhat.com> References: <1426132602-34331-1-git-send-email-snitzer@redhat.com> <1426132602-34331-2-git-send-email-snitzer@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12 2015 at 3:48am -0400, Ming Lei wrote: > On Thu, Mar 12, 2015 at 11:56 AM, Mike Snitzer wrote: > > If percpu_ref_init() fails the 'err_hctxs' label should be used instead > > of 'err_map'. > > > > Signed-off-by: Mike Snitzer > > --- > > block/blk-mq.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/block/blk-mq.c b/block/blk-mq.c > > index 4f4bea2..459840c 100644 > > --- a/block/blk-mq.c > > +++ b/block/blk-mq.c > > @@ -1938,7 +1938,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) > > */ > > if (percpu_ref_init(&q->mq_usage_counter, blk_mq_usage_counter_release, > > PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) > > - goto err_map; > > + goto err_hctxs; > > If it is changed to 'goto err_hctxs', percpu_ref_init() need to > move before blk_alloc_queue_node(), otherwise just 'goto err_hw' > is enough, but the former is better. Yes, you're correct. Patch 2 happened to eliminate this problem. But I'll get it fixed up and post v2. The reason this thinko happened is I noticed the problem after I moved the blk_alloc_queue_node() out in patch 2 and when I rebased to reorder the fix before that patch 2 context got lost in the shuffle. Thanks for your review!