* Patch "nbd: blk_mq_init_queue returns an error code on failure, not NULL" has been added to the 4.9-stable tree
@ 2017-08-09 18:08 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-08-09 18:08 UTC (permalink / raw)
To: jmoyer, alexander.levin, axboe, gregkh, jbacik, osandov
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
nbd: blk_mq_init_queue returns an error code on failure, not NULL
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
nbd-blk_mq_init_queue-returns-an-error-code-on-failure-not-null.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Wed Aug 9 10:32:06 PDT 2017
From: Jeff Moyer <jmoyer@redhat.com>
Date: Mon, 9 Jan 2017 15:20:31 -0500
Subject: nbd: blk_mq_init_queue returns an error code on failure, not NULL
From: Jeff Moyer <jmoyer@redhat.com>
[ Upstream commit 25b4acfc7de0fc4da3bfea3a316f7282c6fbde81 ]
Additionally, don't assign directly to disk->queue, otherwise
blk_put_queue (called via put_disk) will choke (panic) on the errno
stored there.
Bug found by code inspection after Omar found a similar issue in
virtio_blk. Compile-tested only.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/block/nbd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -929,6 +929,7 @@ static int __init nbd_init(void)
return -ENOMEM;
for (i = 0; i < nbds_max; i++) {
+ struct request_queue *q;
struct gendisk *disk = alloc_disk(1 << part_shift);
if (!disk)
goto out;
@@ -954,12 +955,13 @@ static int __init nbd_init(void)
* every gendisk to have its very own request_queue struct.
* These structs are big so we dynamically allocate them.
*/
- disk->queue = blk_mq_init_queue(&nbd_dev[i].tag_set);
- if (!disk->queue) {
+ q = blk_mq_init_queue(&nbd_dev[i].tag_set);
+ if (IS_ERR(q)) {
blk_mq_free_tag_set(&nbd_dev[i].tag_set);
put_disk(disk);
goto out;
}
+ disk->queue = q;
/*
* Tell the block layer that we are not a rotational device
Patches currently in stable-queue which might be from jmoyer@redhat.com are
queue-4.9/nbd-blk_mq_init_queue-returns-an-error-code-on-failure-not-null.patch
queue-4.9/virtio_blk-fix-panic-in-initialization-error-path.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-09 18:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 18:08 Patch "nbd: blk_mq_init_queue returns an error code on failure, not NULL" has been added to the 4.9-stable tree gregkh
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).