From patchwork Wed Oct 19 08:22:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp212707wrs; Wed, 19 Oct 2022 02:08:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZkHb+aAUuK7lrIbilkqBBe2Vnz66G+EJBtupAJIdOBj4O+QMBlu/vnRxiNQy0wHLxuM1/ X-Received: by 2002:a05:6402:2489:b0:454:11de:7698 with SMTP id q9-20020a056402248900b0045411de7698mr6605332eda.214.1666170487099; Wed, 19 Oct 2022 02:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170487; cv=none; d=google.com; s=arc-20160816; b=PwnSsMaJGUBXcla3CLfMVAi94SDTsdV7mHkYnCIbkzNJoq28NAUopHRoxgH5Pr5Tme O5ehkzvMLDU6yU3ZPImckqZBx+Q9rEi4zNjb6qa90piHUciyS92+53wW8mnwlyg08y22 K5GLHYiBfKJBgnA3NE/jc2mNYcn1BK29dXRqN68x9Zwk1cXKN2Q4iexetzcS01GKK/Qu Sc2EoSGRVRt78qN8i1YRnZ3UztnP1HRNX3/HbdjRB5zE0CwV4ZRz/3l2FQji/QXV8GwC rWi7Gf+86Kt3csKEIvrIsaPLYaV2XARL4NaW3sXoSoiVHqkaMLrWjAFgWUn9HA344AJY YwhA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020aa7dd03000000b00456c837e3d0si12092828edv.77.2022.10.19.02.07.33; Wed, 19 Oct 2022 02:08:07 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106384685065407?= X-GMAIL-MSGID: =?utf-8?q?1747106384685065407?= 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)