aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-09-23 04:09:45 -0400
committerNeilBrown <neilb@suse.de>2009-09-23 04:09:45 -0400
commit0da3c6194ec2f32617b272df4505a1cf022faea5 (patch)
tree5864b61b8fac2e7477668bdb9a493d2a64d0b3dd /drivers/md/md.c
parentee305acef5c7841dc25cc32e84bb94f744e1e9b9 (diff)
md: Improve name of threads created by md_register_thread
The management thread for raid4,5,6 arrays are all called mdX_raid5, independent of the actual raid level, which is wrong and can be confusion. So change md_register_thread to use the name from the personality unless no alternate name (like 'resync' or 'reshape') is given. This is simpler and more correct. Cc: Jinzc <zhenchengjin@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index f64b33085255..a3dd3c8ea681 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4218,7 +4218,7 @@ static int do_md_run(mddev_t * mddev)
4218 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); 4218 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
4219 mddev->sync_thread = md_register_thread(md_do_sync, 4219 mddev->sync_thread = md_register_thread(md_do_sync,
4220 mddev, 4220 mddev,
4221 "%s_resync"); 4221 "resync");
4222 if (!mddev->sync_thread) { 4222 if (!mddev->sync_thread) {
4223 printk(KERN_ERR "%s: could not start resync" 4223 printk(KERN_ERR "%s: could not start resync"
4224 " thread...\n", 4224 " thread...\n",
@@ -5631,7 +5631,10 @@ mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev,
5631 thread->run = run; 5631 thread->run = run;
5632 thread->mddev = mddev; 5632 thread->mddev = mddev;
5633 thread->timeout = MAX_SCHEDULE_TIMEOUT; 5633 thread->timeout = MAX_SCHEDULE_TIMEOUT;
5634 thread->tsk = kthread_run(md_thread, thread, name, mdname(thread->mddev)); 5634 thread->tsk = kthread_run(md_thread, thread,
5635 "%s_%s",
5636 mdname(thread->mddev),
5637 name ?: mddev->pers->name);
5635 if (IS_ERR(thread->tsk)) { 5638 if (IS_ERR(thread->tsk)) {
5636 kfree(thread); 5639 kfree(thread);
5637 return NULL; 5640 return NULL;
@@ -6745,7 +6748,7 @@ void md_check_recovery(mddev_t *mddev)
6745 } 6748 }
6746 mddev->sync_thread = md_register_thread(md_do_sync, 6749 mddev->sync_thread = md_register_thread(md_do_sync,
6747 mddev, 6750 mddev,
6748 "%s_resync"); 6751 "resync");
6749 if (!mddev->sync_thread) { 6752 if (!mddev->sync_thread) {
6750 printk(KERN_ERR "%s: could not start resync" 6753 printk(KERN_ERR "%s: could not start resync"
6751 " thread...\n", 6754 " thread...\n",