aboutsummaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorGravatar Guoqing Jiang <jgq516@gmail.com> 2021-06-03 17:21:07 +0800
committerGravatar Song Liu <song@kernel.org> 2021-06-14 22:32:07 -0700
commitde3ea66e9d23a34eef5e17f960d6473f78a1c54b (patch)
treeb5f81f171368f643b87d2ab2490a87569e93566e /drivers/md
parentmd: check level before create and exit io_acct_set (diff)
downloadlinux-de3ea66e9d23a34eef5e17f960d6473f78a1c54b.tar.gz
linux-de3ea66e9d23a34eef5e17f960d6473f78a1c54b.tar.bz2
linux-de3ea66e9d23a34eef5e17f960d6473f78a1c54b.zip
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 <jiangguoqing@kylinos.cn> Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 56b606184c87..2c69905dd5c0 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2343,6 +2343,12 @@ int md_integrity_register(struct mddev *mddev)
if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE) ||
(mddev->level != 1 && mddev->level != 10 &&
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",
mdname(mddev));
return -EINVAL;