Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2813507rwb; Mon, 15 Aug 2022 11:52:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR4XMRaTD7zMpIq/0NSl4ERIlCBBRMnxWyiVDAHN1lPa0F1N0m3GTfOF9zg9TGRvMAFTN9GB X-Received: by 2002:a17:907:6090:b0:734:be0c:e2e7 with SMTP id ht16-20020a170907609000b00734be0ce2e7mr11236188ejc.408.1660589545638; Mon, 15 Aug 2022 11:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589545; cv=none; d=google.com; s=arc-20160816; b=nk6luqtdS6ad9jMYPCxgI3jSm0kjVtYJXJlQxqUkIFLpJEKxe7QTsomL8rHkKDjwF5 V15Z9PIcwRmgapflv4pe4IrTxLcyFAlW8mWYkhdQkmXkAVXQIZ1qwiMm3MtGZxbb1N64 p5ZQnlHVcvqZ0LCyW9YNfRd1OTsWGVgvbROotxy8oB6S3yDTdWlpME7OZvLxTowGWd+1 +CL9d/VIr/1tC/I+7VGwvL8HLLoPhpG8qsSoimVkhFSQh7y1FuTk9WVqR2n+ihV5CThP CfHKixGYNTuLJhslDzpAUr+YirDV0Pd9QwnzQWawIPpFInk0NeRRp2ubP5defuDVTaNg OuRQ== 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=doilji6Bu2Zh3xWa52QwLZz053O0tZtM3BPDtKByUuw=; b=qms/DkXdOb0Hrl2kIt/D/ERaYBE/6udtW4p3/SFqCYd4nKBsHpAT99EFR+hTfgwqAj tlzVvfi21t2MVKLFMdqgDenTLR9NI49XbTvYtU08/XmeZ3mtd+kpqgP++UQ0CAB47Dh0 3cHWYPmIfRuYpIYu/UE7jDwM2GHkePuP/HNhRb6IOtF5jlYw8/nKrP/ro6OBbDMUtmn5 8zyDhXomLeZd+0KJWAF9JMsu1g0OGqKKREE7HXqphZPysOOQl2YFhn4uiBEuMW6/Sihx qpjVrESS1KfG7iPEqdHGHaKptDSyWDXBYOOXL3LGKC/iI797qwWl3RyOKXHhnTV3eck/ X1RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kIgIJX1R; 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 u25-20020a1709064ad900b007313c16ec8fsi7060500ejt.114.2022.08.15.11.51.58; Mon, 15 Aug 2022 11:52:25 -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=kIgIJX1R; 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 S242202AbiHOSkW (ORCPT + 99 others); Mon, 15 Aug 2022 14:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243151AbiHOSjR (ORCPT ); Mon, 15 Aug 2022 14:39:17 -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 0098B3D5B4; Mon, 15 Aug 2022 11:23:53 -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 B2A7DB81063; Mon, 15 Aug 2022 18:23:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23579C433C1; Mon, 15 Aug 2022 18:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587830; bh=HrjeGzSjUbhYge2bysfUgm0Vx0JRUCCCtMSjLG4PpmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kIgIJX1RxbxcEOkP2plsL1hNBI7c8tf6sPPUbhIapSIDKAHfqQkLtyuYW13L2aar3 cNHeTOsdRKCGrszD2bnF0Mtc4Vep2lZD3W+7ao9whYxw3OdnFZg+sK1eQufDQ1XDDs y++lHPdZOFiYn+JsJ8ibe86mQqmSyOIq6mjZ33D8= 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.15 208/779] blk-mq: dont create hctx debugfs dir until q->debugfs_dir is created Date: Mon, 15 Aug 2022 19:57:32 +0200 Message-Id: <20220815180346.163032797@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 3b38d15723de..7023257a133d 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -879,6 +879,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