From patchwork Sat Jul 6 15:50:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11033937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88A2D13A4 for ; Sat, 6 Jul 2019 15:50:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E7EF27F92 for ; Sat, 6 Jul 2019 15:50:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6325D27FA5; Sat, 6 Jul 2019 15:50:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3555727F92 for ; Sat, 6 Jul 2019 15:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbfGFPuq (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-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;