summaryrefslogtreecommitdiffstats
path: root/block/blk-mq-sched.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2017-01-26 12:22:11 -0700
committerJens Axboe <axboe@fb.com>2017-01-26 12:22:11 -0700
commit5a797e00dc93593c9915841779881b15d9856237 (patch)
tree65a3792c4862108140b9b26271788b3fb54368a6 /block/blk-mq-sched.c
parent200e86b3372b51e136a382e007b6b904b1dac7e4 (diff)
downloadlinux-stable-5a797e00dc93593c9915841779881b15d9856237.tar.gz
linux-stable-5a797e00dc93593c9915841779881b15d9856237.tar.bz2
linux-stable-5a797e00dc93593c9915841779881b15d9856237.zip
blk-mq: don't lose flags passed in to blk_mq_alloc_request()
If we come in from blk_mq_alloc_requst() with NOWAIT set in flags, we must ensure that we don't later overwrite that in blk_mq_sched_get_request(). Initialize alloc_data->flags before passing it in. Reported-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq-sched.c')
-rw-r--r--block/blk-mq-sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index d05061f27bb1..56b92db944ae 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -117,7 +117,7 @@ struct request *blk_mq_sched_get_request(struct request_queue *q,
ctx = blk_mq_get_ctx(q);
hctx = blk_mq_map_queue(q, ctx->cpu);
- blk_mq_set_alloc_data(data, q, 0, ctx, hctx);
+ blk_mq_set_alloc_data(data, q, data->flags, ctx, hctx);
if (e) {
data->flags |= BLK_MQ_REQ_INTERNAL;