Commit de3ea66e authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Song Liu

md: add comments in md_integrity_register

Given it is not obvious for the error handling, let's try to add some
comments here to make it clear.
Signed-off-by: default avatarGuoqing Jiang <jiangguoqing@kylinos.cn>
Signed-off-by: default avatarSong Liu <song@kernel.org>
parent daee2024
...@@ -2343,6 +2343,12 @@ int md_integrity_register(struct mddev *mddev) ...@@ -2343,6 +2343,12 @@ int md_integrity_register(struct mddev *mddev)
if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE) || if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE) ||
(mddev->level != 1 && mddev->level != 10 && (mddev->level != 1 && mddev->level != 10 &&
bioset_integrity_create(&mddev->io_acct_set, BIO_POOL_SIZE))) { bioset_integrity_create(&mddev->io_acct_set, BIO_POOL_SIZE))) {
/*
* No need to handle the failure of bioset_integrity_create,
* because the function is called by md_run() -> pers->run(),
* md_run calls bioset_exit -> bioset_integrity_free in case
* of failure case.
*/
pr_err("md: failed to create integrity pool for %s\n", pr_err("md: failed to create integrity pool for %s\n",
mdname(mddev)); mdname(mddev));
return -EINVAL; return -EINVAL;
......
Markdown is supported
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