From patchwork Tue Apr 23 12:29:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 10912865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 939B0112C for ; Tue, 23 Apr 2019 12:30:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8351A28462 for ; Tue, 23 Apr 2019 12:30:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73352286AE; Tue, 23 Apr 2019 12:30:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DC0A28462 for ; Tue, 23 Apr 2019 12:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726150AbfDWM37 (ORCPT ); Tue, 23 Apr 2019 08:29:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:37884 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727225AbfDWM37 (ORCPT ); Tue, 23 Apr 2019 08:29:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C6083AE1D; Tue, 23 Apr 2019 12:29:57 +0000 (UTC) From: Hannes Reinecke To: Ming Lei Cc: Christoph Hellwig , Jens Axboe , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH 4/5] blk-mq: Set hctx pointer to NULL in blk_mq_exit_hw_queues() Date: Tue, 23 Apr 2019 14:29:50 +0200 Message-Id: <20190423122951.134531-5-hare@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190423122951.134531-1-hare@suse.de> References: <20190423122951.134531-1-hare@suse.de> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When clearing the hardware context we should be setting the pointer to NULL, too, to avoid accesses to invalid hctx entries. Signed-off-by: Hannes Reinecke --- block/blk-mq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 3da453b11deb..f620462dc4d1 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2275,6 +2275,7 @@ static void blk_mq_exit_hw_queues(struct request_queue *q, queue_for_each_hw_ctx(q, hctx, i) { blk_mq_debugfs_unregister_hctx(hctx); blk_mq_exit_hctx(q, set, hctx, i); + q->queue_hw_ctx[i] = NULL; } }