提交 ff1ac8f0 编写于 作者: M Mike Snitzer 提交者: Caspar Zhang

dm: fix dm_wq_work() to only use __split_and_process_bio() if appropriate

commit 6548c7c538e5658cbce686c2dd1a9b4f5398bf34 upstream.

Otherwise targets that don't support/expect IO splitting could resubmit
bios using code paths with unnecessary IO splitting complexity.

Depends-on: 24113d487843 ("dm: avoid indirect call in __dm_make_request")
Fixes: 978e51ba ("dm: optimize bio-based NVMe IO submission")
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: NShile Zhang <shile.zhang@linux.alibaba.com>
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 f75c099f
......@@ -1690,6 +1690,15 @@ static blk_qc_t __process_bio(struct mapped_device *md,
return ret;
}
static blk_qc_t dm_process_bio(struct mapped_device *md,
struct dm_table *map, struct bio *bio)
{
if (dm_get_md_type(md) == DM_TYPE_NVME_BIO_BASED)
return __process_bio(md, map, bio);
else
return __split_and_process_bio(md, map, bio);
}
static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio)
{
struct mapped_device *md = q->queuedata;
......@@ -1710,10 +1719,7 @@ static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio)
return ret;
}
if (dm_get_md_type(md) == DM_TYPE_NVME_BIO_BASED)
ret = __process_bio(md, map, bio);
else
ret = __split_and_process_bio(md, map, bio);
ret = dm_process_bio(md, map, bio);
dm_put_live_table(md, srcu_idx);
return ret;
......@@ -2415,9 +2421,9 @@ static void dm_wq_work(struct work_struct *work)
break;
if (dm_request_based(md))
generic_make_request(c);
(void) generic_make_request(c);
else
__split_and_process_bio(md, map, c);
(void) dm_process_bio(md, map, c);
}
dm_put_live_table(md, srcu_idx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册