Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Yu Kuai and committed by
Mike Snitzer
e74c874e bae30287

+9 -18
+9 -18
drivers/md/dm-raid.c
··· 3251 3251 r = md_start(&rs->md); 3252 3252 if (r) { 3253 3253 ti->error = "Failed to start raid array"; 3254 - mddev_unlock(&rs->md); 3255 - goto bad_md_start; 3254 + goto bad_unlock; 3256 3255 } 3257 3256 3258 3257 /* If raid4/5/6 journal mode explicitly requested (only possible with journal dev) -> set it */ ··· 3259 3260 r = r5c_journal_mode_set(&rs->md, rs->journal_dev.mode); 3260 3261 if (r) { 3261 3262 ti->error = "Failed to set raid4/5/6 journal mode"; 3262 - mddev_unlock(&rs->md); 3263 - goto bad_journal_mode_set; 3263 + goto bad_unlock; 3264 3264 } 3265 3265 } 3266 3266 ··· 3269 3271 /* Try to adjust the raid4/5/6 stripe cache size to the stripe size */ 3270 3272 if (rs_is_raid456(rs)) { 3271 3273 r = rs_set_raid456_stripe_cache(rs); 3272 - if (r) { 3273 - mddev_unlock(&rs->md); 3274 - goto bad_stripe_cache; 3275 - } 3274 + if (r) 3275 + goto bad_unlock; 3276 3276 } 3277 3277 3278 3278 /* Now do an early reshape check */ 3279 3279 if (test_bit(RT_FLAG_RESHAPE_RS, &rs->runtime_flags)) { 3280 3280 r = rs_check_reshape(rs); 3281 - if (r) { 3282 - mddev_unlock(&rs->md); 3283 - goto bad_check_reshape; 3284 - } 3281 + if (r) 3282 + goto bad_unlock; 3285 3283 3286 3284 /* Restore new, ctr requested layout to perform check */ 3287 3285 rs_config_restore(rs, &rs_layout); ··· 3286 3292 r = rs->md.pers->check_reshape(&rs->md); 3287 3293 if (r) { 3288 3294 ti->error = "Reshape check failed"; 3289 - mddev_unlock(&rs->md); 3290 - goto bad_check_reshape; 3295 + goto bad_unlock; 3291 3296 } 3292 3297 } 3293 3298 } ··· 3297 3304 mddev_unlock(&rs->md); 3298 3305 return 0; 3299 3306 3300 - bad_md_start: 3301 - bad_journal_mode_set: 3302 - bad_stripe_cache: 3303 - bad_check_reshape: 3307 + bad_unlock: 3308 + mddev_unlock(&rs->md); 3304 3309 md_stop(&rs->md); 3305 3310 bad: 3306 3311 raid_set_free(rs);