aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-07-03 01:56:52 -0400
committerNeilBrown <neilb@suse.de>2012-07-03 01:56:52 -0400
commit0232605d987d8230b254aa139805bbb56a7ca30c (patch)
tree18537d016ecc0f12b41b4589818b4c047cd58bcf /drivers/md/raid5.c
parent055d3747dbf00ce85c6872ecca4d466638e80c22 (diff)
md: make 'name' arg to md_register_thread non-optional.
Having the 'name' arg optional and defaulting to the current personality name is no necessary and leads to errors, as when changing the level of an array we can end up using the name of the old level instead of the new one. So make it non-optional and always explicitly pass the name of the level that the array will be. Reported-by: majianpeng <majianpeng@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 62b6b3a83abf..a5135e595866 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4840,6 +4840,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
4840 int raid_disk, memory, max_disks; 4840 int raid_disk, memory, max_disks;
4841 struct md_rdev *rdev; 4841 struct md_rdev *rdev;
4842 struct disk_info *disk; 4842 struct disk_info *disk;
4843 char pers_name[6];
4843 4844
4844 if (mddev->new_level != 5 4845 if (mddev->new_level != 5
4845 && mddev->new_level != 4 4846 && mddev->new_level != 4
@@ -4963,7 +4964,8 @@ static struct r5conf *setup_conf(struct mddev *mddev)
4963 printk(KERN_INFO "md/raid:%s: allocated %dkB\n", 4964 printk(KERN_INFO "md/raid:%s: allocated %dkB\n",
4964 mdname(mddev), memory); 4965 mdname(mddev), memory);
4965 4966
4966 conf->thread = md_register_thread(raid5d, mddev, NULL); 4967 sprintf(pers_name, "raid%d", mddev->new_level);
4968 conf->thread = md_register_thread(raid5d, mddev, pers_name);
4967 if (!conf->thread) { 4969 if (!conf->thread) {
4968 printk(KERN_ERR 4970 printk(KERN_ERR
4969 "md/raid:%s: couldn't allocate thread.\n", 4971 "md/raid:%s: couldn't allocate thread.\n",