Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1882377rwb; Fri, 19 Aug 2022 11:01:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR5G6PfajGQAlNbivWnZMw/lO70eppa9ioDlWXQhpsVabAjgOpAt+hIWmHUaWQF/UJpY0M92 X-Received: by 2002:a05:6a00:2185:b0:520:7276:6570 with SMTP id h5-20020a056a00218500b0052072766570mr9016249pfi.84.1660932078048; Fri, 19 Aug 2022 11:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660932078; cv=none; d=google.com; s=arc-20160816; b=R/oDphfobps1jQ/IA7/HfRlNI/Y8K1m7z0PIgiKYfww/ipyl2bjfzVVNk7kCjj50jn e/UxSdIm1Q29D86gGU4HoS7M7slfbAzmQOFRosFWAJPKzIOczBrihj89ogo134ZHuQwR Bt06oKqZtZNYT3h0dJYpGayFHjz3GQYbnh7d2JCryED1kSvH6/EE6Z0Hq+tjXE7X5t/D 0cTPIR1OtbWP0V5y48E/RG6dRRvr+DvudNAdtwbdQAoI2sLSQDC7+eoobUle/GaZx5o2 3GDuKKaUHhUKtMkbdDRBJZsmTBDBrAjG92YT1oCqOqqUd+Y/AZusawNO/A+ISjZ5KPl5 8Krg== 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=ncIFVqM44I8HmHqijDFW61tKn1MkJH/6tps93qWYPNQ=; b=r/Dse0aVhBLjhDV3DqjQp60qm08fKWZhrNUqp/p0uj4XRG1aEimB+gn4jp9oSOpoO0 u2mKiaRK0JDqJAqp2Cyt2toMs0aZh5OE6JIYVe8lk+sZYpBGYAppXPC5iMHkkWH2d1qV t0mqkhaZ6mSy7AWngdGMFvAQxS8Xzsw+MxFduaKwdcozmtOhuhximRQcGXfbu6+bu+gN 95FkFfVJTEiH38GLYrBCCaN4CIE//WDMN6cQP/OVsfQX7dgXWoHaPGikoRz1qGmmlWTU Z5503bCjM+A8EUE2PFUtv8bxr/S/qqkD6Vj/ATCQN6MogdMDyczieslFGmk19IHyO7jp HPnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dZvwIRl/"; 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 d1-20020a170903230100b001729bbf257fsi2993979plh.112.2022.08.19.11.01.07; Fri, 19 Aug 2022 11:01:18 -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="dZvwIRl/"; 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 S1351194AbiHSQD5 (ORCPT + 99 others); Fri, 19 Aug 2022 12:03:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351318AbiHSQBS (ORCPT ); Fri, 19 Aug 2022 12:01:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E68310A74B; Fri, 19 Aug 2022 08:52:58 -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 5C6D5616B3; Fri, 19 Aug 2022 15:52:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63DF8C433C1; Fri, 19 Aug 2022 15:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924344; bh=sGSXDUXdTqKHgHCdAfBZV56DJ9OAdRWGh6IRIAjerCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dZvwIRl/pub0Qz9Z5IbyvjZV7fuPm6gXfwMqaNG4cv560kVsl0szrW9xVpU7fIsQ2 XP7y0RDLqKTPN7GNWpDxDlI94VdKv9rfF445bL0RVnVapFuuiJCSVD6XDaU+ZKtS1L lHfQaME9cRWHFydhb6lKQegjD3hOeQtXmZh/e6Uc= 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.10 139/545] blk-mq: dont create hctx debugfs dir until q->debugfs_dir is created Date: Fri, 19 Aug 2022 17:38:29 +0200 Message-Id: <20220819153835.557391749@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 b5f26082b959..212e1e795469 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -881,6 +881,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