Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp826297rwi; Wed, 19 Oct 2022 03:32:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7xpY1EZ+l7K9Z3Q5sLYPN//Lru/8oXawiICACEjeXGeGxItLXl5dDU11QPZHoul+qat5kU X-Received: by 2002:a17:907:60d3:b0:78d:f874:3267 with SMTP id hv19-20020a17090760d300b0078df8743267mr6096685ejc.409.1666175566571; Wed, 19 Oct 2022 03:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666175566; cv=none; d=google.com; s=arc-20160816; b=VBmbO12x5BGb2v0WokFXn+HO1Eg7r+4EAU7s0qLIbYkwOpC8rWeGW1beLiVqouAVIU fJXaWgs9xaeIyFMbCHouoW8veOo6Gwin5Afb4Vml7r3Nl+m6X49fPx8kQGFGs0r89tJD +QwJs2EzgE09yciWUpoEjp82nKoFNw4k1eSFEnZRiklsc+XQBfEqQoj0Fx/RcPW/MRD3 NsQm9ZEWkwGqj88ayE1zvnajrVCAYK8+kdU13jozDjERx2WzBWytHz+ZmNI1AVmHnKBM DWraqnaWbNxMhSxp2PUB9ADJ2scb9d3j/1QIg6JIhyzS54weylO3NTMDSJyeYipQhpjE nJIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TW826vAKXuOrryw/6+DW8pbOkbYkeAdYmnPeHLAfYP0=; b=dfmOQ9AgrNxGtfYJ/cehz+D3L6WZmmiEurgaT74i/IibVp9aZL91d9KPk732YFaYJs G4tq9WNWaO0FPzba5Q33sx8UC+ErwjEc8sMNaiMrgvRji7JSS2za/BiCVPmu3XSZunrB xQdb+qTq9ufEygbWoqMLI5XjSWIjgSksSSjQI0Z4DojTszOD0kPDGcJEQ6trfME1+zJC fC6Pqr1u/LzllorZMGZv3c/1Td7hFB8E7xNvyBAzdIqiHygFsIrJWnHHX++kaLacQk59 6UAdyWXOM4LHwsWgrS9B3xVIndIMKCcg3WZZxDc1mKRlCEvlqzgzU1vZGzWQ9Ive90F9 JSXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PoKjleNI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg7-20020a170907a40700b00779e6c93108si11673908ejc.598.2022.10.19.03.32.19; Wed, 19 Oct 2022 03:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PoKjleNI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232238AbiJSJB0 (ORCPT + 99 others); Wed, 19 Oct 2022 05:01:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232214AbiJSI7R (ORCPT ); Wed, 19 Oct 2022 04:59:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAAB0BE35; Wed, 19 Oct 2022 01:54:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8AF66617E4; Wed, 19 Oct 2022 08:42:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B59AC433D7; Wed, 19 Oct 2022 08:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168976; bh=ON2evzD/PvT7GNtyEBzFcCThvASigkcrWtkR+/CpAo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PoKjleNIQWbXH34kVp1zlgpYcrM/sO8XTNTkKjWZWfLgeKSW6mGYKwyO8VGA1cEaU A5lIXZuekNU35bO0Lzmyue7nKKK6XqLAOZCw1QhfNRZ7kntGeA+Fi8gVdmhC79HqkK kXQP3qJvFR3NrV/uJrJKoqxrxtqsjS44DVX+C+AU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yogev Cohen , Sagi Grimberg , Christoph Hellwig Subject: [PATCH 6.0 068/862] nvme-multipath: fix possible hang in live ns resize with ANA access Date: Wed, 19 Oct 2022 10:22:35 +0200 Message-Id: <20221019083252.928169244@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sagi Grimberg commit 72e3b8883a36e80ebfa41015c7b6926ce31ace05 upstream. When we revalidate paths as part of ns size change (as of commit e7d65803e2bb), it is possible that during the path revalidation, the only paths that is IO capable (i.e. optimized/non-optimized) are the ones that ns resize was not yet informed to the host, which will cause inflight requests to be requeued (as we have available paths but none are IO capable). These requests on the requeue list are waiting for someone to resubmit them at some point. The IO capable paths will eventually notify the ns resize change to the host, but there is nothing that will kick the requeue list to resubmit the queued requests. Fix this by always kicking the requeue list, and if no IO capable path exists, these requests will be queued again. A typical log that indicates that IOs are requeued: -- nvme nvme1: creating 4 I/O queues. nvme nvme1: new ctrl: "testnqn1" nvme nvme2: creating 4 I/O queues. nvme nvme2: mapped 4/0/0 default/read/poll queues. nvme nvme2: new ctrl: NQN "testnqn1", addr 127.0.0.1:8009 nvme nvme1: rescanning namespaces. nvme1n1: detected capacity change from 2097152 to 4194304 block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O block nvme1n1: no usable path - requeuing I/O nvme nvme2: rescanning namespaces. -- Reported-by: Yogev Cohen Fixes: e7d65803e2bb ("nvme-multipath: revalidate paths during rescan") Signed-off-by: Sagi Grimberg Cc: # v5.15+ Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/multipath.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -182,6 +182,7 @@ void nvme_mpath_revalidate_paths(struct for_each_node(node) rcu_assign_pointer(head->current_path[node], NULL); + kblockd_schedule_work(&head->requeue_work); } static bool nvme_path_is_disabled(struct nvme_ns *ns)