summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2023-07-08 12:21:52 +0300
committerMike Snitzer <snitzer@kernel.org>2023-07-25 18:55:50 +0300
commite74c874eabe2e9173a8fbdad616cd89c70eb8ffd (patch)
tree4340145bbbd735796f4bc12084dc34e370adc77a /drivers/md
parentbae3028799dc4f1109acc4df37c8ff06f2d8f1a0 (diff)
downloadlinux-e74c874eabe2e9173a8fbdad616cd89c70eb8ffd.tar.xz
dm raid: clean up four equivalent goto tags in raid_ctr()
There are four equivalent goto tags in raid_ctr(), clean them up to use just one. There is no functional change and this is preparation to fix raid_ctr()'s unprotected md_stop(). Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-raid.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 3d7366b912bf..845b68c3fd5f 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3251,8 +3251,7 @@ size_check:
r = md_start(&rs->md);
if (r) {
ti->error = "Failed to start raid array";
- mddev_unlock(&rs->md);
- goto bad_md_start;
+ goto bad_unlock;
}
/* If raid4/5/6 journal mode explicitly requested (only possible with journal dev) -> set it */
@@ -3260,8 +3259,7 @@ size_check:
r = r5c_journal_mode_set(&rs->md, rs->journal_dev.mode);
if (r) {
ti->error = "Failed to set raid4/5/6 journal mode";
- mddev_unlock(&rs->md);
- goto bad_journal_mode_set;
+ goto bad_unlock;
}
}
@@ -3271,19 +3269,15 @@ size_check:
/* Try to adjust the raid4/5/6 stripe cache size to the stripe size */
if (rs_is_raid456(rs)) {
r = rs_set_raid456_stripe_cache(rs);
- if (r) {
- mddev_unlock(&rs->md);
- goto bad_stripe_cache;
- }
+ if (r)
+ goto bad_unlock;
}
/* Now do an early reshape check */
if (test_bit(RT_FLAG_RESHAPE_RS, &rs->runtime_flags)) {
r = rs_check_reshape(rs);
- if (r) {
- mddev_unlock(&rs->md);
- goto bad_check_reshape;
- }
+ if (r)
+ goto bad_unlock;
/* Restore new, ctr requested layout to perform check */
rs_config_restore(rs, &rs_layout);
@@ -3292,8 +3286,7 @@ size_check:
r = rs->md.pers->check_reshape(&rs->md);
if (r) {
ti->error = "Reshape check failed";
- mddev_unlock(&rs->md);
- goto bad_check_reshape;
+ goto bad_unlock;
}
}
}
@@ -3304,10 +3297,8 @@ size_check:
mddev_unlock(&rs->md);
return 0;
-bad_md_start:
-bad_journal_mode_set:
-bad_stripe_cache:
-bad_check_reshape:
+bad_unlock:
+ mddev_unlock(&rs->md);
md_stop(&rs->md);
bad:
raid_set_free(rs);