md/raid1: don't free conf on raid0_run failure

BugLink: https://bugs.launchpad.net/bugs/2083196

[ Upstream commit 17f91ac0843b50462a9c9c8f18df962338bd3db2 ]

The core md code calls the ->free method which already frees conf.

Fixes: 07f1a6850c ("md/raid1: fail run raid1 array when active disk less than one")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240604172607.3185916-3-hch@lst.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
This commit is contained in:
Christoph Hellwig
2024-06-04 19:25:29 +02:00
committed by Mehmet Basaran
parent 6d215584a0
commit 3adea29952
+2 -10
View File
@@ -3121,7 +3121,6 @@ static struct r1conf *setup_conf(struct mddev *mddev)
return ERR_PTR(err);
}
static void raid1_free(struct mddev *mddev, void *priv);
static int raid1_run(struct mddev *mddev)
{
struct r1conf *conf;
@@ -3174,8 +3173,7 @@ static int raid1_run(struct mddev *mddev)
*/
if (conf->raid_disks - mddev->degraded < 1) {
md_unregister_thread(mddev, &conf->thread);
ret = -EINVAL;
goto abort;
return -EINVAL;
}
if (conf->raid_disks - mddev->degraded == 1)
@@ -3199,14 +3197,8 @@ static int raid1_run(struct mddev *mddev)
md_set_array_sectors(mddev, raid1_size(mddev, 0, 0));
ret = md_integrity_register(mddev);
if (ret) {
if (ret)
md_unregister_thread(mddev, &mddev->thread);
goto abort;
}
return 0;
abort:
raid1_free(mddev, conf);
return ret;
}