From patchwork Fri Sep 22 15:09:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 9966345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6734C600C5 for ; Fri, 22 Sep 2017 15:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54A03293CC for ; Fri, 22 Sep 2017 15:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 496CE294E0; Fri, 22 Sep 2017 15:04:23 +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=-6.9 required=2.0 tests=BAYES_00,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 E90F8293CC for ; Fri, 22 Sep 2017 15:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752422AbdIVPEW (ORCPT ); Fri, 22 Sep 2017 11:04:22 -0400 Received: from mga11.intel.com ([192.55.52.93]:14443 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319AbdIVPEW (ORCPT ); Fri, 22 Sep 2017 11:04:22 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2017 08:04:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="1222409351" Received: from unknown (HELO localhost.localdomain) ([10.232.112.96]) by fmsmga002.fm.intel.com with ESMTP; 22 Sep 2017 08:04:21 -0700 Date: Fri, 22 Sep 2017 11:09:16 -0400 From: Keith Busch To: Christoph Hellwig Cc: Jens Axboe , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org Subject: Re: [PATCH 9/9] nvme: implement multipath access to nvme subsystems Message-ID: <20170922150915.GA1294@localhost.localdomain> References: <20170918231453.27128-1-hch@lst.de> <20170918231453.27128-10-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170918231453.27128-10-hch@lst.de> User-Agent: Mutt/1.7.1 (2016-10-04) 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 On Mon, Sep 18, 2017 at 04:14:53PM -0700, Christoph Hellwig wrote: > +static void nvme_failover_req(struct request *req) > +{ > + struct nvme_ns *ns = req->q->queuedata; > + unsigned long flags; > + > + spin_lock_irqsave(&ns->head->requeue_lock, flags); > + blk_steal_bios(&ns->head->requeue_list, req); > + spin_unlock_irqrestore(&ns->head->requeue_lock, flags); > + > + nvme_reset_ctrl(ns->ctrl); > + kblockd_schedule_work(&ns->head->requeue_work); > +} Need to call blk_mq_free_req after stealing all its bios to prevent leaking that entered request. All together, I needed just two small changes to the entire series to get everything testing successfully. Here's the diff on top of your set: --- -- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 5449c83..55620ba 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -115,6 +115,8 @@ static void nvme_failover_req(struct request *req) blk_steal_bios(&ns->head->requeue_list, req); spin_unlock_irqrestore(&ns->head->requeue_lock, flags); + blk_mq_free_request(req); + nvme_reset_ctrl(ns->ctrl); kblockd_schedule_work(&ns->head->requeue_work); } @@ -1935,6 +1937,9 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) { struct nvme_subsystem *subsys, *found; + if (ctrl->identified) + return 0; + subsys = kzalloc(sizeof(*subsys), GFP_KERNEL); if (!subsys) return -ENOMEM;