Skip to content

Commit b527ac4

Browse files
committed
Merge tag 'for-6.3/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fixes from Mike Snitzer: - Fix two DM core bugs in the code that handles splitting "abnormal" IO (discards, write same and secure erase) and issuing that IO to the correct underlying devices (and offsets within those devices). * tag 'for-6.3/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: fix __send_duplicate_bios() to always allow for splitting IO dm: fix improper splitting for abnormal bios
2 parents 0d3ff80 + 666eed4 commit b527ac4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/md/dm.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,8 @@ static void setup_split_accounting(struct clone_info *ci, unsigned int len)
14671467
}
14681468

14691469
static void alloc_multiple_bios(struct bio_list *blist, struct clone_info *ci,
1470-
struct dm_target *ti, unsigned int num_bios)
1470+
struct dm_target *ti, unsigned int num_bios,
1471+
unsigned *len)
14711472
{
14721473
struct bio *bio;
14731474
int try;
@@ -1478,7 +1479,7 @@ static void alloc_multiple_bios(struct bio_list *blist, struct clone_info *ci,
14781479
if (try)
14791480
mutex_lock(&ci->io->md->table_devices_lock);
14801481
for (bio_nr = 0; bio_nr < num_bios; bio_nr++) {
1481-
bio = alloc_tio(ci, ti, bio_nr, NULL,
1482+
bio = alloc_tio(ci, ti, bio_nr, len,
14821483
try ? GFP_NOIO : GFP_NOWAIT);
14831484
if (!bio)
14841485
break;
@@ -1513,8 +1514,10 @@ static int __send_duplicate_bios(struct clone_info *ci, struct dm_target *ti,
15131514
ret = 1;
15141515
break;
15151516
default:
1517+
if (len)
1518+
setup_split_accounting(ci, *len);
15161519
/* dm_accept_partial_bio() is not supported with shared tio->len_ptr */
1517-
alloc_multiple_bios(&blist, ci, ti, num_bios);
1520+
alloc_multiple_bios(&blist, ci, ti, num_bios, len);
15181521
while ((clone = bio_list_pop(&blist))) {
15191522
dm_tio_set_flag(clone_to_tio(clone), DM_TIO_IS_DUPLICATE_BIO);
15201523
__map_bio(clone);

0 commit comments

Comments
 (0)