Commit ca52248
Mike Snitzer
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: 7ecc56c ("block: allow passing a NULL bdev to bio_alloc_clone/bio_init_clone")
Signed-off-by: Mike Snitzer <[email protected]>1 parent d254c36 commit ca52248
1 file changed
+24
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
585 | 587 | | |
586 | 588 | | |
587 | 589 | | |
| |||
613 | 615 | | |
614 | 616 | | |
615 | 617 | | |
616 | | - | |
| 618 | + | |
617 | 619 | | |
618 | 620 | | |
619 | 621 | | |
| |||
624 | 626 | | |
625 | 627 | | |
626 | 628 | | |
627 | | - | |
628 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
629 | 632 | | |
630 | 633 | | |
| 634 | + | |
| 635 | + | |
631 | 636 | | |
632 | 637 | | |
633 | 638 | | |
| |||
1012 | 1017 | | |
1013 | 1018 | | |
1014 | 1019 | | |
1015 | | - | |
1016 | 1020 | | |
1017 | 1021 | | |
1018 | 1022 | | |
1019 | 1023 | | |
1020 | 1024 | | |
1021 | 1025 | | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
| 1026 | + | |
| 1027 | + | |
1030 | 1028 | | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
1034 | 1042 | | |
1035 | 1043 | | |
1036 | 1044 | | |
| |||
0 commit comments