From: Jens Axboe Date: Mon, 16 Jun 2014 17:40:25 +0000 (-0600) Subject: null_blk: fix softirq completions for queue_mode == 1 X-Git-Tag: Ubuntu-5.10.0-12.13~16741^2~4 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d891fa70876b37941a5c5bed813e73beb53ebcf7;p=mirror_ubuntu-hirsute-kernel.git null_blk: fix softirq completions for queue_mode == 1 Only blk-mq completions have payload attached to the request, for request_fn mode we have stored it in req->special. This fixes an oops with queue_mode=1 and softirq completions. Signed-off-by: Jens Axboe --- diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index f87c4c4c1c41..a3b042c4d448 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -227,7 +227,10 @@ static void null_cmd_end_timer(struct nullb_cmd *cmd) static void null_softirq_done_fn(struct request *rq) { - end_cmd(blk_mq_rq_to_pdu(rq)); + if (queue_mode == NULL_Q_MQ) + end_cmd(blk_mq_rq_to_pdu(rq)); + else + end_cmd(rq->special); } static inline void null_handle_cmd(struct nullb_cmd *cmd)