Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3018377rwb; Mon, 15 Aug 2022 16:15:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR43lTwT5XicyQscwJpg9pOnU8LqfK3RJaQIaGYVA94m1kmlOXLvmcRGpvVXGA8hsLrBUH3V X-Received: by 2002:a17:907:20d1:b0:731:5169:106b with SMTP id qq17-20020a17090720d100b007315169106bmr11913296ejb.667.1660605310049; Mon, 15 Aug 2022 16:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605310; cv=none; d=google.com; s=arc-20160816; b=GqpeeQiHLBwqBS3PRyRShmQYXUkMB44a2b0C3+yxPCRJE1TcnB8DP/bBssgh6NBi5B osLYndluOBJyqlcFv8cYaWC6CrxVbKvk/TZn3T/pw/vS2wLp+yGTRnoPzj7KQjFhG84E 4NC+51/w5PWCWIz7gq8U+wA3yktMLpqnep6OaVF0QdNuYL3LNHne+mePDspU6BaqbcA4 Xr9jYkQyVcZblta55Zf4hxmgPo5OK9b0bFA9rtLXaRPHOuzqlTL/wUuRK18gqR0pShJ7 O0ShFSRPds5y7tnb9mhpfEy3O7HHOh9ZC0wHUCKhpfP6tTZbhO2jczvzqV82GFs44bo/ GI4w== 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=9yDA2rc7KDEbQFbT63Y01IMnvyguQLZltwg2YfKq2Cs=; b=i05l2pvRaEgaPZArMyweNODhCSoOqUhYnXwgoAKzvIaWb5Mk81vsmAd1RT6F3Xfitm xLe02D+C601xfsDw6twVU9Q2uC5ca/IlIW7irn2wdCFliqkb3HM5ORxvpBCdcUUoLQEA Zn5gh/vuHx+q8AKGh0Vv2bkf4/BPAHZs3OUoSGwSRkyyQWTMEOjRbGYDqfoHRsKXkhkG TztUAv3Ss5IWjYqea9DvFuW/gtsdGQ9X9wbxPOB82LFPA/O3Zjgne/agomOiD2faYXtF 8vftvT9nul91Nnk84m3UrSOTWvnnTmpz4CHm6znUrZ18dNYNCGITQSg9JUuXDHg33nAn f2ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gcXJyxvt; 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 a21-20020aa7d755000000b00441d03ea21asi6796075eds.488.2022.08.15.16.14.23; Mon, 15 Aug 2022 16:15: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=gcXJyxvt; 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 S1345566AbiHOUuZ (ORCPT + 99 others); Mon, 15 Aug 2022 16:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346042AbiHOUtb (ORCPT ); Mon, 15 Aug 2022 16:49:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EDA4B95A5; Mon, 15 Aug 2022 12:09:19 -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 EDD4D60BC2; Mon, 15 Aug 2022 19:09:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAAD9C433D7; Mon, 15 Aug 2022 19:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590558; bh=HKEPZdH7dHXhOAmPXvweHSiuwJ2DvZSpsN7WJIndf8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gcXJyxvtIquKrih6nu66MMl7cQrYWnUJLjSe7dM4xUhDChn1yGdU9oXbD/Gemm7o+ nwC75lpffX8fBQ/261RHW2v+ApSV8YZJ+634Ypl/k0lnFq72RaZUljtGt+MnlEeK7f izQIpK7cwnhFskntQu1Qhl+cC5SKPNxzkj9ZRhu8= 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.18 0267/1095] blk-mq: dont create hctx debugfs dir until q->debugfs_dir is created Date: Mon, 15 Aug 2022 19:54:26 +0200 Message-Id: <20220815180440.794310899@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 aa0349e9f083..34bee263936c 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -737,6 +737,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