diff options
author | Christoph Hellwig <hch@lst.de> | 2022-06-08 08:34:06 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-06-08 20:04:14 +0200 |
commit | 29dec90a0f1d961b93f34f910e9319d8cb23edbd (patch) | |
tree | a9661e0821f7c983ae0c799f70f862ee2d58533b /drivers/md/dm-core.h | |
parent | Linux 5.19-rc1 (diff) | |
download | linux-29dec90a0f1d961b93f34f910e9319d8cb23edbd.tar.xz linux-29dec90a0f1d961b93f34f910e9319d8cb23edbd.zip |
dm: fix bio_set allocation
The use of bioset_init_from_src mean that the pre-allocated pools weren't
used for anything except parameter passing, and the integrity pool
creation got completely lost for the actual live mapped_device. Fix that
by assigning the actual preallocated dm_md_mempools to the mapped_device
and using that for I/O instead of creating new mempools.
Fixes: 2a2a4c510b76 ("dm: use bioset_init_from_src() to copy bio_set")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-core.h')
-rw-r--r-- | drivers/md/dm-core.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/dm-core.h b/drivers/md/dm-core.h index d21648a923ea..54c0473a51dd 100644 --- a/drivers/md/dm-core.h +++ b/drivers/md/dm-core.h @@ -33,6 +33,14 @@ struct dm_kobject_holder { * access their members! */ +/* + * For mempools pre-allocation at the table loading time. + */ +struct dm_md_mempools { + struct bio_set bs; + struct bio_set io_bs; +}; + struct mapped_device { struct mutex suspend_lock; @@ -110,8 +118,7 @@ struct mapped_device { /* * io objects are allocated from here. */ - struct bio_set io_bs; - struct bio_set bs; + struct dm_md_mempools *mempools; /* kobject and completion */ struct dm_kobject_holder kobj_holder; |