From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C216FC48BD3 for ; Sat, 6 Jul 2019 15:50:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92A3B20989 for ; Sat, 6 Jul 2019 15:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562428247; bh=DoMosQyj+D2mjOogflP8YGGJ6A9R8/xlAkdk2iL0qLk=; h=Date:From:To:Cc:Subject:List-ID:From; b=fEK8IG33M6026CQhTorw/64s7gFIVh0wsr4E3LAKHVW0hdMP5FbbwOlkTfkgjiede jRZDuFtlWoSCW6BqYx3nIidTfQ2N6ysKjTaxLjUCrM66GTSyATw4fRFtI+8NvEISdJ vpFe5ss5Vtvn19Wn20DvovkDK30ogKknbqRbpxcs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727063AbfGFPuq (ORCPT ); Sat, 6 Jul 2019 11:50:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:38638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726794AbfGFPuq (ORCPT ); Sat, 6 Jul 2019 11:50:46 -0400 Received: from localhost (unknown [62.119.166.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 123AE20838; Sat, 6 Jul 2019 15:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562428245; bh=DoMosQyj+D2mjOogflP8YGGJ6A9R8/xlAkdk2iL0qLk=; h=Date:From:To:Cc:Subject:From; b=kbjtnzPQNMvZHlhZ/kx7zMACMZ7PPjTCyuSNTZ93unBmycxP/8i7lY0yA/VpfVq9r rgmzBLFZkfc6hpAGJs6Ys68JjkqahB6er5JvH7gooh+lVn78rR6XMmDq7hG27Dt9sk K+Bi4RvnPAtYT3HrHkd0CPHOzRBhi8R5nhs4ZihM= Date: Sat, 6 Jul 2019 17:50:32 +0200 From: Greg Kroah-Hartman To: Stephen Rothwell , Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, stable Subject: [PATCH] blk-mq: fix up placement of debugfs directory of queue files Message-ID: <20190706155032.GA3106@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the blk-mq debugfs file creation logic was "cleaned up" it was cleaned up too much, causing the queue file to not be created in the correct location. Turns out the check for the directory being present is needed as if that has not happened yet, the files should not be created, and the function will be called later on in the initialization code so that the files can be created in the correct location. Fixes: 6cfc0081b046 ("blk-mq: no need to check return value of debugfs_create functions") Reported-by: Stephen Rothwell Cc: Jens Axboe Cc: linux-block@vger.kernel.org Cc: stable # 5.2+ Signed-off-by: Greg Kroah-Hartman --- block/blk-mq-debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 2489ddbb21db..3afe327f816f 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -934,6 +934,13 @@ void blk_mq_debugfs_register_sched(struct request_queue *q) { struct elevator_type *e = q->elevator->type; + /* + * If the parent directory has not been created yet, return, we will be + * called again later on and the directory/files will be created then. + */ + if (!q->debugfs_dir) + return; + if (!e->queue_debugfs_attrs) return; -- 2.22.0