On 5/21/21 3:32 PM, Artur Paszkiewicz wrote:
@@ -2340,9 +2383,12 @@ int md_integrity_register(struct mddev *mddev)
bdev_get_integrity(reference->bdev));
pr_debug("md: data integrity enabled on %s\n", mdname(mddev));
- if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE)) {
+ if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE) ||
+ bioset_integrity_create(&mddev->md_io_bs, BIO_POOL_SIZE)) {
pr_err("md: failed to create integrity pool for %s\n",
mdname(mddev));
+ bioset_exit(&mddev->bio_set);
+ bioset_exit(&mddev->md_io_bs);
return -EINVAL;
Are you sure bioset_exit() here is correct? This is always called from
pers->run() and the cleanup in case of error is handled in md_run().
You are right! Maybe it deserves additional comment given it is
not obvious. Will drop it.
Thanks,
Guoqing