From patchwork Tue Apr 28 13:29:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiping Zhang X-Patchwork-Id: 11514659 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B94114DD for ; Tue, 28 Apr 2020 13:29:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 763E3206D9 for ; Tue, 28 Apr 2020 13:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgD1N3p (ORCPT ); Tue, 28 Apr 2020 09:29:45 -0400 Received: from 22.17.110.36.static.bjtelecom.net ([36.110.17.22]:15008 "HELO bsf02.didichuxing.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with SMTP id S1726825AbgD1N3p (ORCPT ); Tue, 28 Apr 2020 09:29:45 -0400 X-ASG-Debug-ID: 1588080583-0e4108595c572bd0001-Cu09wu Received: from mail.didiglobal.com (localhost [172.20.36.244]) by bsf02.didichuxing.com with ESMTP id Nh6F0sN2F8w2LoFQ; Tue, 28 Apr 2020 21:29:43 +0800 (CST) X-Barracuda-Envelope-From: zhangweiping@didiglobal.com Received: from 192.168.3.9 (172.22.50.20) by BJSGEXMBX03.didichuxing.com (172.20.15.133) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 28 Apr 2020 21:29:42 +0800 Date: Tue, 28 Apr 2020 21:29:41 +0800 From: Weiping Zhang To: , , CC: Subject: [RESEND v4 2/6] block: save previous hardware queue count before udpate Message-ID: X-ASG-Orig-Subj: [RESEND v4 2/6] block: save previous hardware queue count before udpate Mail-Followup-To: axboe@kernel.dk, tom.leiming@gmail.com, bvanassche@acm.org, linux-block@vger.kernel.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [172.22.50.20] X-ClientProxiedBy: BJEXCAS03.didichuxing.com (172.20.36.245) To BJSGEXMBX03.didichuxing.com (172.20.15.133) X-Barracuda-Connect: localhost[172.20.36.244] X-Barracuda-Start-Time: 1588080583 X-Barracuda-URL: https://bsf02.didichuxing.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at didichuxing.com X-Barracuda-Scan-Msg-Size: 865 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.81478 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org blk_mq_realloc_tag_set_tags will update set->nr_hw_queues, so save old set->nr_hw_queues before call this function. Reviewed-by: Bart Van Assche Signed-off-by: Weiping Zhang Reviewed-by: Ming Lei --- 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 f789b3e1b3ab..a79afbe60ca6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3347,11 +3347,11 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, blk_mq_sysfs_unregister(q); } + prev_nr_hw_queues = set->nr_hw_queues; if (blk_mq_realloc_tag_set_tags(set, set->nr_hw_queues, nr_hw_queues) < 0) goto reregister; - prev_nr_hw_queues = set->nr_hw_queues; set->nr_hw_queues = nr_hw_queues; blk_mq_update_queue_map(set); fallback: