Skip to content

Commit 71ce67f

Browse files
committed
dm: fix __send_duplicate_bios() to always allow for splitting IO
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author Mike Snitzer <[email protected]> commit 666eed4 Commit 7dd76d1 ("dm: improve bio splitting and associated IO accounting") only called setup_split_accounting() from __send_duplicate_bios() if a single bio were being issued. But the case where duplicate bios are issued must call it too. Otherwise the bio won't be split and resubmitted (via recursion through block core back to DM) to submit the later portions of a bio (which may map to an entirely different target). For example, when discarding an entire DM striped device with the following DM table: vg-lvol0: 0 159744 striped 2 128 7:0 2048 7:1 2048 vg-lvol0: 159744 45056 striped 2 128 7:2 2048 7:3 2048 Before (broken, discards the first striped target's devices twice): device-mapper: striped: target_stripe=0, bdev=7:0, start=2048 len=79872 device-mapper: striped: target_stripe=1, bdev=7:1, start=2048 len=79872 device-mapper: striped: target_stripe=0, bdev=7:0, start=2049 len=22528 device-mapper: striped: target_stripe=1, bdev=7:1, start=2048 len=22528 After (works as expected): device-mapper: striped: target_stripe=0, bdev=7:0, start=2048 len=79872 device-mapper: striped: target_stripe=1, bdev=7:1, start=2048 len=79872 device-mapper: striped: target_stripe=0, bdev=7:2, start=2048 len=22528 device-mapper: striped: target_stripe=1, bdev=7:3, start=2048 len=22528 Fixes: 7dd76d1 ("dm: improve bio splitting and associated IO accounting") Cc: [email protected] Reported-by: Orange Kao <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> (cherry picked from commit 666eed4) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 6947fa1 commit 71ce67f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/md/dm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,8 @@ static int __send_duplicate_bios(struct clone_info *ci, struct dm_target *ti,
15701570
ret = 1;
15711571
break;
15721572
default:
1573+
if (len)
1574+
setup_split_accounting(ci, *len);
15731575
/* dm_accept_partial_bio() is not supported with shared tio->len_ptr */
15741576
alloc_multiple_bios(&blist, ci, ti, num_bios);
15751577
while ((clone = bio_list_pop(&blist))) {

0 commit comments

Comments
 (0)