Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7319447rwi; Mon, 24 Oct 2022 12:55:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+S2ADniWNCbNwIgkBV8TNhSl/UFjuonCYjzs3sYhEZ9yo2T3qnCTSoEzUG4kWv03wRjN7 X-Received: by 2002:a17:907:c05:b0:73d:6e0a:8d22 with SMTP id ga5-20020a1709070c0500b0073d6e0a8d22mr29238763ejc.646.1666641310733; Mon, 24 Oct 2022 12:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666641310; cv=none; d=google.com; s=arc-20160816; b=Wmji98eRgwTRqyy828hHCPFghFBblwZCnGIQGc0JYrU85ZJe/NBG1m+YEHo2NVudcC JdnVi8Yk+IdB6Ab+I8s05BxTZ8Y9KpYJINUyZ8BESXzGitDLppv8QrrhTloX3vFd8JVK RtVbCra89XNm6brN2AR3018JlLu8UVkbAxZpoQNc6kGAHiCFMfLfrT/oMuECaQOqJuRy u9B60K1lCME6WCc6RpXjtin8mSNBgG9vMMnb40gS5teWjZGUps72LEm/79yD02THNMR0 ENdQWj0kTB2ZrTmlF+pfSHjUJBLHx9AGC8CDI2lB4R8XcsYwzF5GW+DFkZPwFAlDU38m eJUg== 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=rnBZ+1TaIeW2C4O5RcVbQPUAfSGtIIp0t9MwoVufEMU=; b=BY/S0ZeWVQOSF8P0AkqGyvr5lGQ6eYjspbNORvIiPrBtIRcnI7ZNujI0e1R5PXlYsb ketYTzIJOwJ6g7hSwwryHBEtlZQ7FgWWhwwTBWkZzyyYYoHf5Hb+WYGKaRKi/WuV57va P1Guyv6WFIqcQHqDcwne6QJfyMkKRb+m9L4D5kq6eFXeem5WbwP+tlAYHoiooz+wB3ox EeizfeCsizT2wvTarb4p8Ulkdbj7VTM3ybz4NfX0sgkmugdr82ikfyKlA6d+mdsovtAM PznU+78HWnKkUBKlwtvQnr2/EOhjb5mI/SkcFzPXNbtWeC06tpZcJPsTXUceWFjA9zMo qQNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MBQQ1W3s; 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 qk6-20020a1709077f8600b0078db71898f2si531876ejc.851.2022.10.24.12.54.45; Mon, 24 Oct 2022 12:55:10 -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=MBQQ1W3s; 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 S233480AbiJXTxP (ORCPT + 99 others); Mon, 24 Oct 2022 15:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233422AbiJXTv6 (ORCPT ); Mon, 24 Oct 2022 15:51:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C83619018; Mon, 24 Oct 2022 11:17:27 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6CC11B8159F; Mon, 24 Oct 2022 12:35:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2270C433D6; Mon, 24 Oct 2022 12:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614904; bh=LpiUvsiYqsEHApJ9nSrkZUrMrXWWj4Ku9RYWHfSqT6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MBQQ1W3s/9gh6/UEAEOBDGSnEHbeURP0imrLPlrSAZJfp1Qn/emWLbjSUE/TmIEAY r/frSH74wzRJJ+L4lpPiFCuSMx90VmBR/H9l28sFg/KmztG/w94rzLGi2L8iS3zftJ Ivtq0+cyc2a7MdUimEvrs4c9EwUrN2rhbZO1o+d8= 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 5.15 048/530] nvme-multipath: fix possible hang in live ns resize with ANA access Date: Mon, 24 Oct 2022 13:26:32 +0200 Message-Id: <20221024113047.191473289@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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.6 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 @@ -159,6 +159,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)