diff options
author | Jens Axboe <axboe@fb.com> | 2016-08-23 08:24:37 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-09-08 12:10:26 -0600 |
commit | acff7227ff55a5d5db78d56e813ef85ab1827d0b (patch) | |
tree | 6806359aee4980e39a75f676f13dbbc83525cd70 | |
parent | f4f5253edcda3532f236667202648c2047033fcc (diff) |
blk-mq-dio: move partition remap AFTER adding bio payloadblk-dio
Otherwise the bio will be empty, and blk_partition_remap() won't
do anything. Oops, caused corruption.
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | block/blk-mq-dio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-mq-dio.c b/block/blk-mq-dio.c index cde205ecf5f4..76c332975001 100644 --- a/block/blk-mq-dio.c +++ b/block/blk-mq-dio.c @@ -280,7 +280,6 @@ ssize_t blk_direct_IO(struct kiocb *iocb, struct inode *inode, bio = bio_alloc(GFP_KERNEL, (ret + pgoff + PAGE_SIZE - 1) >> PAGE_SHIFT); bio->bi_bdev = bdev; bio->bi_iter.bi_sector = offset >> blkbits; - blk_partition_remap(bio); total_len = ret; i = ret = 0; @@ -300,6 +299,8 @@ ssize_t blk_direct_IO(struct kiocb *iocb, struct inode *inode, i++; } + blk_partition_remap(bio); + if (iov_iter_rw(iter) == WRITE) { op = REQ_OP_WRITE; op_flags = WRITE_ODIRECT; |