Skip to content

Commit de3ea66

Browse files
GuoqingJiang-Linuxliu-song-6
authored andcommitted
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: Guoqing Jiang <[email protected]> Signed-off-by: Song Liu <[email protected]>
1 parent daee202 commit de3ea66

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/md/md.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,12 @@ int md_integrity_register(struct mddev *mddev)
23432343
if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE) ||
23442344
(mddev->level != 1 && mddev->level != 10 &&
23452345
bioset_integrity_create(&mddev->io_acct_set, BIO_POOL_SIZE))) {
2346+
/*
2347+
* No need to handle the failure of bioset_integrity_create,
2348+
* because the function is called by md_run() -> pers->run(),
2349+
* md_run calls bioset_exit -> bioset_integrity_free in case
2350+
* of failure case.
2351+
*/
23462352
pr_err("md: failed to create integrity pool for %s\n",
23472353
mdname(mddev));
23482354
return -EINVAL;

0 commit comments

Comments
 (0)