summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-12-22 16:00:25 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-12-22 16:00:25 -0800
commit24bc3ea5df2e1d89e9d50ecca57c210b87ad61d2 (patch)
treeac85fbb100151d235aa141fdf4294829a556b1d2 /drivers/block
parent0bee6ec80b92d853d6cad3c35fb5f1dd2d88b8f8 (diff)
parente8271201462710dbbaa0448b768428606724ca90 (diff)
downloadop-kernel-dev-24bc3ea5df2e1d89e9d50ecca57c210b87ad61d2.zip
op-kernel-dev-24bc3ea5df2e1d89e9d50ecca57c210b87ad61d2.tar.gz
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block layer fixes from Jens Axboe: "Three small fixes for 4.4 final. Specifically: - The segment issue fix from Junichi, where the old IO path does a bio limit split before potentially bouncing the pages. We need to do that in the right order, to ensure that limitations are met. - A NVMe surprise removal IO hang fix from Keith. - A use-after-free in null_blk, introduced by a previous patch in this series. From Mike Krinkin" * 'for-linus' of git://git.kernel.dk/linux-block: null_blk: fix use-after-free error block: ensure to split after potentially bouncing a bio NVMe: IO ending fixes on surprise removal
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/null_blk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index 8162475..a428e4e 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -219,6 +219,9 @@ static void end_cmd(struct nullb_cmd *cmd)
{
struct request_queue *q = NULL;
+ if (cmd->rq)
+ q = cmd->rq->q;
+
switch (queue_mode) {
case NULL_Q_MQ:
blk_mq_end_request(cmd->rq, 0);
@@ -232,9 +235,6 @@ static void end_cmd(struct nullb_cmd *cmd)
goto free_cmd;
}
- if (cmd->rq)
- q = cmd->rq->q;
-
/* Restart queue if needed, as we are freeing a tag */
if (q && !q->mq_ops && blk_queue_stopped(q)) {
unsigned long flags;
OpenPOWER on IntegriCloud