Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3029888rwb; Mon, 15 Aug 2022 16:28:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4/jzFgIQV/SdQr0qbcU5F/6Rcc0JG5469BGdXBJyG7IyxdV0gj4MOb5ZoghQBRm+9Xlr5k X-Received: by 2002:a05:6402:254b:b0:43e:910f:caea with SMTP id l11-20020a056402254b00b0043e910fcaeamr16707183edb.423.1660606130484; Mon, 15 Aug 2022 16:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660606130; cv=none; d=google.com; s=arc-20160816; b=adPQY3sUrhsqn/OkiZAx71wJuvKO1c1T2Hu2arF2RrBnN0bbese0e9LN//6a3Bu8Ej U1W9TWExCz36InlNavFqmjSwWt4N6pvw/0m87g/BeGGJhTgMZ7McNuk4MCOTErUWc6KO cgsnYA3ZPx/P7HUb6GCR7sbWpJkiibQyZOWCDa7KkycAaUjohMKNz5be64fL4SkHWkZS HdwI5BXIZ+Ye/ghHGc8u1a80jo+uC+DH4gLppxp000+HXfnal+sDotL2N21CM9SaGjAs UVuxXSX5CjjwOYwwwdLWyEhUnet6IeUh6vcyE2VqxIG57ZsDNOCa21c5nqLXXJcAI1Js TJ+A== 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=uy20kvR/oJWojsYPJ90ZNcHiTHgTCX6Ha5ZHx+VBQzU=; b=WnXCf83OhJtgFoYr5MunwBPw7pprKf+4XSGfYjuf3+632ZWbnheHAVcsvZ79q1+zNf ZbaxdTjqad8wtWXknugWTqIOZlazQF54cDv/4FSVNE1vMATWT8PKWlKR9EbxdpZ+wB6D 0e0t9GwXs3q56RRV3djaRSzyMeex5moAu6TWtrW6CvpkzKKsi50Oa+2iinzzgGoN3E4O QB1PLBpIBpX2iDNBnPjnS7xJZg9HPi5KEBxKFSBBmhyGWMc3F5TyQllu9sYiY3va1zIM mN966AsTIA4ZbNqnI+PBqWcIQguWJXEIPLnnUOpHYNWwjgWFxzVD3OAqes4eOIiaRT9+ eJmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FcgfNt1D; 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 e14-20020a056402190e00b0043e8dd308a6si10844776edz.8.2022.08.15.16.28.23; Mon, 15 Aug 2022 16:28:50 -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=FcgfNt1D; 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 S1352998AbiHOXBu (ORCPT + 99 others); Mon, 15 Aug 2022 19:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351871AbiHOW7O (ORCPT ); Mon, 15 Aug 2022 18:59:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2536E76452; Mon, 15 Aug 2022 12:57:22 -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 885CA60FD8; Mon, 15 Aug 2022 19:57:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74E01C433D6; Mon, 15 Aug 2022 19:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593440; bh=sgYSD0j/s9y/c4VoEzXbjidbj5aLl52XfgJNB+JormI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FcgfNt1D2iF1kCKY5wfvU2PTJ9TTOtfbwAX1xuty8NsDOf04CViQ5G2Wxx2vZrDx3 3JUzhfUqUOr7fvndBdG6mDFJYq0isj3FLCxrYYIvdSfFvojCOEF2QFK8BvHmiMIMTK 7F8cIYzI/wuE0eOUIZINmcYXZUDn2u/sBarO4reU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yi Zhang , Ming Lei , Christoph Hellwig , Jens Axboe , Sasha Levin Subject: [PATCH 5.19 0268/1157] blk-mq: dont create hctx debugfs dir until q->debugfs_dir is created Date: Mon, 15 Aug 2022 19:53:44 +0200 Message-Id: <20220815180450.328660119@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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.1 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,T_SCC_BODY_TEXT_LINE 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: Ming Lei [ Upstream commit f3ec5d11554778c24ac8915e847223ed71d104fc ] blk_mq_debugfs_register_hctx() can be called by blk_mq_update_nr_hw_queues when gendisk isn't added yet, such as nvme tcp. Fixes the warning of 'debugfs: Directory 'hctx0' with parent '/' already present!' which can be observed reliably when running blktests nvme/005. Fixes: 6cfc0081b046 ("blk-mq: no need to check return value of debugfs_create functions") Reported-by: Yi Zhang Signed-off-by: Ming Lei Tested-by: Yi Zhang Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220711090808.259682-1-ming.lei@redhat.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-mq-debugfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 4d1ce9ef4318..61f179e5f151 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -730,6 +730,9 @@ void blk_mq_debugfs_register_hctx(struct request_queue *q, char name[20]; int i; + if (!q->debugfs_dir) + return; + snprintf(name, sizeof(name), "hctx%u", hctx->queue_num); hctx->debugfs_dir = debugfs_create_dir(name, q->debugfs_dir); -- 2.35.1