linux/drivers/md
Mike Snitzer 8b7c731e54 dm: fix __send_duplicate_bios() to always allow for splitting IO
commit 666eed4676 upstream.

Commit 7dd76d1fee ("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: 7dd76d1fee ("dm: improve bio splitting and associated IO accounting")
Cc: stable@vger.kernel.org
Reported-by: Orange Kao <orange@aiven.io>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-06 12:10:52 +02:00
..
bcache bcache: Silence memcpy() run-time false positive warnings 2023-02-09 11:28:14 +01:00
persistent-data
dm-audit.c
dm-audit.h
dm-bio-prison-v1.c
dm-bio-prison-v1.h
dm-bio-prison-v2.c
dm-bio-prison-v2.h
dm-bio-record.h
dm-bufio.c dm: improve shrinker debug names 2023-03-10 09:33:19 +01:00
dm-builtin.c
dm-cache-background-tracker.c dm cache: free background tracker's queued work in btracker_destroy 2023-03-10 09:34:23 +01:00
dm-cache-background-tracker.h
dm-cache-block-types.h
dm-cache-metadata.c dm cache: Fix ABBA deadlock between shrink_slab and dm_cache_metadata_abort 2023-01-07 11:11:44 +01:00
dm-cache-metadata.h
dm-cache-policy-internal.h
dm-cache-policy-smq.c
dm-cache-policy.c
dm-cache-policy.h dm cache: delete the redundant word 'each' in comment 2022-10-18 17:17:47 -04:00
dm-cache-target.c dm cache: add cond_resched() to various workqueue loops 2023-03-10 09:34:01 +01:00
dm-clone-metadata.c
dm-clone-metadata.h
dm-clone-target.c dm clone: Fix UAF in clone_dtr() 2023-01-07 11:11:45 +01:00
dm-core.h
dm-crypt.c dm crypt: avoid accessing uninitialized tasklet 2023-03-30 12:49:30 +02:00
dm-delay.c
dm-dust.c
dm-ebs-target.c
dm-era-target.c
dm-exception-store.c
dm-exception-store.h
dm-flakey.c dm flakey: fix a bug with 32-bit highmem systems 2023-03-10 09:34:23 +01:00
dm-ima.c
dm-ima.h
dm-init.c
dm-integrity.c dm integrity: Fix UAF in dm_integrity_dtr() 2023-01-07 11:11:45 +01:00
dm-io-rewind.c
dm-io-tracker.h
dm-io.c
dm-ioctl.c dm: send just one event on resize, not two 2023-03-10 09:34:21 +01:00
dm-kcopyd.c
dm-linear.c
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c dm-log-writes: set dma_alignment limit in io_hints 2022-11-16 15:58:11 -07:00
dm-log.c
dm-mpath.c
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-ps-historical-service-time.c
dm-ps-io-affinity.c
dm-ps-queue-length.c
dm-ps-round-robin.c
dm-ps-service-time.c
dm-raid.c dm raid: fix typo in analyse_superblocks code comment 2022-10-18 17:17:47 -04:00
dm-raid1.c
dm-region-hash.c
dm-rq.c dm: change from DMWARN to DMERR or DMCRIT for fatal errors 2022-10-18 17:16:00 -04:00
dm-rq.h
dm-snap-persistent.c
dm-snap-transient.c
dm-snap.c
dm-stats.c dm stats: check for and propagate alloc_percpu failure 2023-03-30 12:49:30 +02:00
dm-stats.h dm stats: check for and propagate alloc_percpu failure 2023-03-30 12:49:30 +02:00
dm-stripe.c
dm-switch.c
dm-sysfs.c
dm-table.c dm: change from DMWARN to DMERR or DMCRIT for fatal errors 2022-10-18 17:16:00 -04:00
dm-target.c
dm-thin-metadata.c dm thin: Use last transaction's pmd->root when commit failed 2023-01-07 11:11:45 +01:00
dm-thin-metadata.h
dm-thin.c dm thin: fix deadlock when swapping to thin device 2023-03-30 12:49:23 +02:00
dm-uevent.c
dm-uevent.h
dm-unstripe.c
dm-verity-fec.c
dm-verity-fec.h
dm-verity-loadpin.c
dm-verity-target.c dm verity: enable WQ_HIGHPRI on verify_wq 2022-10-18 17:17:47 -04:00
dm-verity-verify-sig.c
dm-verity-verify-sig.h
dm-verity.h
dm-writecache.c
dm-zero.c
dm-zone.c
dm-zoned-metadata.c dm: improve shrinker debug names 2023-03-10 09:33:19 +01:00
dm-zoned-reclaim.c
dm-zoned-target.c
dm-zoned.h
dm.c dm: fix __send_duplicate_bios() to always allow for splitting IO 2023-04-06 12:10:52 +02:00
dm.h dm: send just one event on resize, not two 2023-03-10 09:34:21 +01:00
Kconfig md: select BLOCK_LEGACY_AUTOLOAD 2023-03-22 13:33:58 +01:00
Makefile
md-autodetect.c
md-bitmap.c md/bitmap: Fix bitmap chunk size overflow issues 2023-01-07 11:11:51 +01:00
md-bitmap.h
md-cluster.c
md-cluster.h
md-faulty.c
md-linear.c
md-linear.h
md-multipath.c
md-multipath.h
md.c md: avoid signed overflow in slot_store() 2023-04-06 12:10:39 +02:00
md.h
raid1-10.c
raid1.c md/raid1: stop mdx_raid1 thread when raid1 array run failed 2022-12-31 13:33:02 +01:00
raid1.h
raid5-cache.c treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
raid5-log.h
raid5-ppl.c
raid5.c
raid5.h
raid10.c md/raid0, raid10: Don't set discard sectors for request queue 2022-12-31 13:33:01 +01:00
raid10.h
raid0.c md/raid0, raid10: Don't set discard sectors for request queue 2022-12-31 13:33:01 +01:00
raid0.h