Skip to content

Commit

Permalink
dm: fix dm_wq_work() to only use __split_and_process_bio() if appropr…
Browse files Browse the repository at this point in the history
…iate

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

Depends-on: 24113d4 ("dm: avoid indirect call in __dm_make_request")
Fixes: 978e51b ("dm: optimize bio-based NVMe IO submission")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Mike Snitzer committed Jan 22, 2019
1 parent a1e1cb7 commit 6548c7c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,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;
Expand All @@ -1745,10 +1754,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;
Expand Down Expand Up @@ -2427,9 +2433,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);
Expand Down

0 comments on commit 6548c7c

Please sign in to comment.