Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A5CDC38A2D for ; Tue, 25 Oct 2022 14:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbiJYOki (ORCPT ); Tue, 25 Oct 2022 10:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231820AbiJYOkf (ORCPT ); Tue, 25 Oct 2022 10:40:35 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CE593AE6C for ; Tue, 25 Oct 2022 07:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=O2CsPyNJx/1XAhKbZV22EItyN19VA0haIpF9VEV8Dws=; b=UGwcknT0R0wp5MIpfkAz2n3CCr /7/TPv2WA/KdAgHCFiibDoR06cnGI6MBGBtIOXxsPg8oE1Db6J4HAPbOqtLbdwEWrcQe+HEq3w9/H cmX2OB3qH9GqlYO6hDfpShtAoUg57AGP6kZMiUjY5A/7+FuRWST9OkM7kJkDfuO3FPU0Wc2PtHjBU oUoX00wznh5cryexb6SgO+u6SE0RdYMcbPc463ayZ909qulL7UgMxxl09qWuRis0W6IdmlbccyJrz wq7wCeRyQJL/ycRod5AXfQFUvypJq9vL/12vxhn3AWrwmmgTTaKFpNB+NKSsJaaEnSSwoYUXk9r8c KXk4qcgw==; Received: from [12.47.128.130] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1onL6M-005pms-Dw; Tue, 25 Oct 2022 14:40:22 +0000 From: Christoph Hellwig To: Jens Axboe , Keith Busch , Sagi Grimberg , Chao Leng Cc: Ming Lei , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org Subject: [PATCH 06/17] nvme: remove the NVME_NS_DEAD check in nvme_remove_invalid_namespaces Date: Tue, 25 Oct 2022 07:40:09 -0700 Message-Id: <20221025144020.260458-7-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221025144020.260458-1-hch@lst.de> References: <20221025144020.260458-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The NVME_NS_DEAD check only made sense when we revalidated namespaces in nvme_passthrough_end for commands that affected the namespace inventory. These days NVME_NS_DEAD is only set during reset or when tearing down namespaces, and we always remove all namespaces right after that. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 50b440e1a0ca0..2ec838e608509 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4407,7 +4407,7 @@ static void nvme_remove_invalid_namespaces(struct nvme_ctrl *ctrl, down_write(&ctrl->namespaces_rwsem); list_for_each_entry_safe(ns, next, &ctrl->namespaces, list) { - if (ns->head->ns_id > nsid || test_bit(NVME_NS_DEAD, &ns->flags)) + if (ns->head->ns_id > nsid) list_move_tail(&ns->list, &rm_list); } up_write(&ctrl->namespaces_rwsem); -- 2.30.2