From 57bf088e1a7429b93efdf2608805ad0b939505f6 Mon Sep 17 00:00:00 2001 From: Coly Li Date: Apr 13 2024 06:52:15 +0000 Subject: dm raid: clean up four equivalent goto tags in raid_ctr() (git-fixes). --- diff --git a/patches.suse/dm-raid-clean-up-four-equivalent-goto-tags-in-raid_c-e74c.patch b/patches.suse/dm-raid-clean-up-four-equivalent-goto-tags-in-raid_c-e74c.patch new file mode 100644 index 0000000..dfca21f --- /dev/null +++ b/patches.suse/dm-raid-clean-up-four-equivalent-goto-tags-in-raid_c-e74c.patch @@ -0,0 +1,96 @@ +From e74c874eabe2e9173a8fbdad616cd89c70eb8ffd Mon Sep 17 00:00:00 2001 +From: Yu Kuai +Date: Sat, 8 Jul 2023 17:21:52 +0800 +Subject: [PATCH] dm raid: clean up four equivalent goto tags in raid_ctr() +Git-commit: e74c874eabe2e9173a8fbdad616cd89c70eb8ffd +Patch-mainline: v6.5-rc4 +References: git-fixes + +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 +Signed-off-by: Mike Snitzer +Signed-off-by: Coly Li + +--- + drivers/md/dm-raid.c | 27 +++++++++------------------ + 1 file 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 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) + 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 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) + 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 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) + /* 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 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) + 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 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) + 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); +-- +2.35.3 + diff --git a/series.conf b/series.conf index b330482..4c86900 100644 --- a/series.conf +++ b/series.conf @@ -43200,6 +43200,7 @@ patches.suse/ASoC-rt711-sdca-fix-for-JD-event-handling-in-ClockSt.patch patches.suse/ASoC-atmel-Fix-the-8K-sample-parameter-in-I2SC-maste.patch patches.suse/dm-raid-fix-missing-reconfig_mutex-unlock-in-raid_ct-bae3.patch + patches.suse/dm-raid-clean-up-four-equivalent-goto-tags-in-raid_c-e74c.patch patches.suse/s390-dasd-fix-hanging-device-after-quiesce-resume.patch patches.suse/s390-dasd-use-correct-number-of-retries-for-ERP-requests.patch patches.suse/s390-dasd-fix-hanging-device-after-request-requeue.patch