From patchwork Fri Mar 8 17:40:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10845227 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 D92AD1515 for ; Fri, 8 Mar 2019 17:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF62A2E571 for ; Fri, 8 Mar 2019 17:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B37BC2ED91; Fri, 8 Mar 2019 17:39:37 +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 613542E571 for ; Fri, 8 Mar 2019 17:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726721AbfCHRjg (ORCPT ); Fri, 8 Mar 2019 12:39:36 -0500 Received: from mga01.intel.com ([192.55.52.88]:33276 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbfCHRjg (ORCPT ); Fri, 8 Mar 2019 12:39:36 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2019 09:39:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,456,1544515200"; d="scan'208";a="132430649" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.69]) by orsmga003.jf.intel.com with ESMTP; 08 Mar 2019 09:39:36 -0800 From: Keith Busch To: linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Jens Axboe Cc: Christoph Hellwig , Sagi Grimberg , Keith Busch Subject: [PATCH 4/5] nvme: Fail dead namespace's entered requests Date: Fri, 8 Mar 2019 10:40:05 -0700 Message-Id: <20190308174006.5032-4-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190308174006.5032-1-keith.busch@intel.com> References: <20190308174006.5032-1-keith.busch@intel.com> 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 End the entered requests on a quieced queue directly rather than flush them through the low level driver's queue_rq(). Signed-off-by: Keith Busch --- drivers/nvme/host/core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index cc5d9a83d5af..7095406bb293 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -94,6 +94,13 @@ static void nvme_put_subsystem(struct nvme_subsystem *subsys); static void nvme_remove_invalid_namespaces(struct nvme_ctrl *ctrl, unsigned nsid); +static bool nvme_fail_request(struct blk_mq_hw_ctx *hctx, struct request *req, + void *data, bool reserved) +{ + blk_mq_end_request(req, BLK_STS_IOERR); + return true; +} + static void nvme_set_queue_dying(struct nvme_ns *ns) { /* @@ -104,8 +111,7 @@ static void nvme_set_queue_dying(struct nvme_ns *ns) return; revalidate_disk(ns->disk); blk_set_queue_dying(ns->queue); - /* Forcibly unquiesce queues to avoid blocking dispatch */ - blk_mq_unquiesce_queue(ns->queue); + blk_mq_queue_tag_busy_iter(ns->queue, nvme_fail_request, NULL); } static void nvme_queue_scan(struct nvme_ctrl *ctrl)