* [PATCH] blk-mq: fix up placement of debugfs directory of queue files
@ 2019-07-06 15:50 Greg Kroah-Hartman
2019-07-06 16:07 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-06 15:50 UTC (permalink / raw)
To: Stephen Rothwell, Jens Axboe; +Cc: linux-block, linux-kernel, stable
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 <sfr@canb.auug.org.au>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Cc: stable <stable@vger.kernel.org> # 5.2+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-mq: fix up placement of debugfs directory of queue files
2019-07-06 15:50 [PATCH] blk-mq: fix up placement of debugfs directory of queue files Greg Kroah-Hartman
@ 2019-07-06 16:07 ` Jens Axboe
2019-07-06 16:50 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2019-07-06 16:07 UTC (permalink / raw)
To: Greg Kroah-Hartman, Stephen Rothwell; +Cc: linux-block, linux-kernel, stable
On 7/6/19 9:50 AM, Greg Kroah-Hartman wrote:
> 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.
How about we shove this in for 5.2 final? Trivial enough to do, and it
would suck to have 5.2 released with this. Though not sure what
devices this actually impacts, I haven't noticed anything awry on
my setups?
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-mq: fix up placement of debugfs directory of queue files
2019-07-06 16:07 ` Jens Axboe
@ 2019-07-06 16:50 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-06 16:50 UTC (permalink / raw)
To: Jens Axboe; +Cc: Stephen Rothwell, linux-block, linux-kernel, stable
On Sat, Jul 06, 2019 at 10:07:14AM -0600, Jens Axboe wrote:
> On 7/6/19 9:50 AM, Greg Kroah-Hartman wrote:
> > 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.
>
> How about we shove this in for 5.2 final? Trivial enough to do, and it
> would suck to have 5.2 released with this.
Sure, no objection from me!
> Though not sure what devices this actually impacts, I haven't noticed
> anything awry on my setups?
I can easily trigger this with loop devices. I know Stephen reported
this and I don't know if that was the driver that caused it for him. I
have also seen this happen in syzbot boot logs already, but again, don't
know what block devices they are using that causes this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-06 16:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-06 15:50 [PATCH] blk-mq: fix up placement of debugfs directory of queue files Greg Kroah-Hartman
2019-07-06 16:07 ` Jens Axboe
2019-07-06 16:50 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).