Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4608783ybi; Sat, 6 Jul 2019 08:52:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXXXL09+61z56pLDBTrUG4NIW3BvwnRR678OXh4301IeWLrfYgEbXc1WOLD5A/hWJ5u0Fb X-Received: by 2002:a17:902:bcc4:: with SMTP id o4mr11980361pls.90.1562428333565; Sat, 06 Jul 2019 08:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562428333; cv=none; d=google.com; s=arc-20160816; b=Xxuxjex91EEjDuZL9Ii8xdr9l1dzZZgI/WH6DxEs2kGRbs9VuI7WFzWJPI5kWPOGed VW0FIkgMs6Aqa6LAtEwlDpzyYttJkwKZYqA/vdrCHA3JK7XFiS2mIOpzlXZzGKp60ud8 PECzhPXma08VMbS2nG1pt5myeh+hyLlHqzyiCpxmjGnWLIs7IHa24nWaIvkmtHNwW0tm SzEtZhX/8XbU3bPC+8BMEQdWkN/a2Frs5HdO0VkkJmAHyICmaR6NOVuPi+i0KT+U4hyA y8SrnNshzSy62iPL/+McNZYGKBE7Maf+xnj+SRH0qlVscNOV8PHH80gobOP+wHvGH6Nf vFog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=aOfM/KXbOwQGngMbZaHvu9EQjXysfpx0vtFUBNgT7N4=; b=vC/5D0sC+0kq1ptIWzbvpzhhQ1VTpPYc6T9bHGVCE+Pu6k3GX8kRRj89D94BGrmy7x +SYQ+I0Zk4xqtgFfAcPYlIHqlRE2hqo12oK79R5uvS5KlGpNsh6uVVhy8UEHqsqqiZ8R AITU04E6Ar2yIPIpzdt0x0mb9B/TNewYO88Nmjc2QITPl+dgbC642Z4+pm441VRSP9Om U1yb/SjOgzMgvA6WvzfoErEBLHf5JGcYQ2TCyGLZrMgyooc+aUEcW1TZRR2hJXjWdtrd lXpS9g/e6q8XydgJUW77iPeURIe6T3uoxTRq876ONLDhf/vLFAU//ERPVvMHKjE4CGdT szOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kbjtnzPQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e66si11998931plb.254.2019.07.06.08.51.58; Sat, 06 Jul 2019 08:52:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kbjtnzPQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727053AbfGFPuq (ORCPT + 99 others); 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