Skip to content
Commit ca522482 authored by Mike Snitzer's avatar Mike Snitzer
Browse files

dm: pass NULL bdev to bio_alloc_clone

Most DM targets will remap the clone bio passed to their ->map
function using bio_set_bdev(). So this change to pass NULL bdev to
bio_alloc_clone avoids clone-time work that sets up resources for a
bdev association that will not be used in practice (e.g. clone issued
to underlying device will not use DM device's blk-cgroups resources).

But clone->bi_bdev is still initialized following bio_alloc_clone to
preserve DM target expectations that clone->bi_bdev will be set.
Follow-up work is needed to audit DM targets to remove accesses to a
clone->bi_bdev that the target didn't initialize with bio_set_dev().

Depends-on: 7ecc56c6

 ("block: allow passing a NULL bdev to bio_alloc_clone/bio_init_clone")
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent d254c369
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment