From patchwork Mon Oct 24 11:26:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10090 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp625355wru; Mon, 24 Oct 2022 12:54:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zw4VzqAj0JNX+GZDNQ3m9zaNf6YTR9JkrD1y8pYl0rT2l+llI4ou9jArMdV4E8hPhqSNd X-Received: by 2002:a05:6402:274c:b0:461:9cbd:8ad5 with SMTP id z12-20020a056402274c00b004619cbd8ad5mr9629272edd.349.1666641244805; Mon, 24 Oct 2022 12:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666641244; cv=none; d=google.com; s=arc-20160816; b=YZ+5r9RPuESh/ujEYcVhUgRBglXlJFw8G7ia7nEyCfL4nfoJFeWLNJhkKdsNEHA7Pk TrDtjVDPLDooWKCuLCZd5SyfsedX+WO/NSER9UVAjayAT3X5SvSdQGdHNKo2v+TjXqW9 2KXJBso+VnMKHDMeVi+YikHvZ3WrmTKz9qTHSY/rURgcPbYRDUTdFFNED/8aIZ6rOSNV 8F3v1ZWaaGV0qb7PltwNQruRaSfLSJ8hLwu8q0coWODmHlmdknST0RCuEtJfe+g2aoFw LY3ziYJpaPS+CVTo6Ces7kZZxHA/YjPP2RycUGuICfekpBiSpmSLKTuGCKIG4cusF2FW Sc7w== 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 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.53.41; Mon, 24 Oct 2022 12:54:04 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747600010215005787?= X-GMAIL-MSGID: =?utf-8?q?1747600010215005787?= 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)