From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753440AbdLGRpF (ORCPT ); Thu, 7 Dec 2017 12:45:05 -0500 Received: from fldsmtpe03.verizon.com ([140.108.26.142]:60839 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755545AbdLGPt0 (ORCPT ); Thu, 7 Dec 2017 10:49:26 -0500 From: alexander.levin@verizon.com Cc: Sagi Grimberg , Jens Axboe , alexander.levin@verizon.com X-Host: pioneer.tdc.vzwcorp.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.9 026/156] blk-mq: Fix tagset reinit in the presence of cpu hot-unplug Thread-Topic: [PATCH AUTOSEL for 4.9 026/156] blk-mq: Fix tagset reinit in the presence of cpu hot-unplug Thread-Index: AQHTb3LmOIMDQCubo0iHjf6WVjVV5g== Date: Thu, 7 Dec 2017 15:49:00 +0000 Message-ID: <20171207154845.4814-26-alexander.levin@verizon.com> References: <20171207154845.4814-1-alexander.levin@verizon.com> In-Reply-To: <20171207154845.4814-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vB7Hj8UL002244 From: Sagi Grimberg [ Upstream commit 0067d4b020ea07a58540acb2c5fcd3364bf326e0 ] In case cpu was unplugged, we need to make sure not to assume that the tags for that cpu are still allocated. so check for null tags when reinitializing a tagset. Reported-by: Yi Zhang Signed-off-by: Sagi Grimberg Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-mq-tag.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index dcf5ce3ba4bf..4bc701b32ce2 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -311,6 +311,9 @@ int blk_mq_reinit_tagset(struct blk_mq_tag_set *set) for (i = 0; i < set->nr_hw_queues; i++) { struct blk_mq_tags *tags = set->tags[i]; + if (!tags) + continue; + for (j = 0; j < tags->nr_tags; j++) { if (!tags->rqs[j]) continue; -- 2.11.0