Reapply "dm: requeue IO if mapping table not yet available"

This reverts commit 5fed567365.
This commit is contained in:
Ksawlii 2024-11-24 00:23:19 +01:00
parent fffb3a7453
commit 5c05951d21
2 changed files with 4 additions and 11 deletions

View file

@ -496,10 +496,8 @@ static blk_status_t dm_mq_queue_rq(struct blk_mq_hw_ctx *hctx,
map = dm_get_live_table(md, &srcu_idx);
if (unlikely(!map)) {
DMERR_LIMIT("%s: mapping table unavailable, erroring io",
dm_device_name(md));
dm_put_live_table(md, srcu_idx);
return BLK_STS_IOERR;
return BLK_STS_RESOURCE;
}
ti = dm_table_find_target(map, 0);
dm_put_live_table(md, srcu_idx);

View file

@ -1697,15 +1697,10 @@ static blk_qc_t dm_submit_bio(struct bio *bio)
struct dm_table *map;
map = dm_get_live_table(md, &srcu_idx);
if (unlikely(!map)) {
DMERR_LIMIT("%s: mapping table unavailable, erroring io",
dm_device_name(md));
bio_io_error(bio);
goto out;
}
/* If suspended, queue this IO for later */
if (unlikely(test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags))) {
/* If suspended, or map not yet available, queue this IO for later */
if (unlikely(test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags)) ||
unlikely(!map)) {
if (bio->bi_opf & REQ_NOWAIT)
bio_wouldblock_error(bio);
else if (bio->bi_opf & REQ_RAHEAD)