[PATCH] md: move bitmap_create to after md array has been initialised
This is important because bitmap_create uses mddev->resync_max_sectors and that doesn't have a valid value until after the array has been initialised (with pers->run()). [It doesn't make a difference for current personalities that support bitmaps, but will make a difference for raid10] This has the added advantage of meaning with can move the thread->timeout manipulation inside the bitmap.c code instead of sprinkling identical code throughout all personalities. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
6ff8d8ec06
commit
b15c2e57f0
@@ -1990,9 +1990,6 @@ static int run(mddev_t *mddev)
|
||||
/* Ok, everything is just fine now */
|
||||
mddev->array_size = mddev->size * (mddev->raid_disks - 2);
|
||||
|
||||
if (mddev->bitmap)
|
||||
mddev->thread->timeout = mddev->bitmap->daemon_sleep * HZ;
|
||||
|
||||
mddev->queue->unplug_fn = raid6_unplug_device;
|
||||
mddev->queue->issue_flush_fn = raid6_issue_flush;
|
||||
return 0;
|
||||
@@ -2228,14 +2225,8 @@ static void raid6_quiesce(mddev_t *mddev, int state)
|
||||
spin_unlock_irq(&conf->device_lock);
|
||||
break;
|
||||
}
|
||||
if (mddev->thread) {
|
||||
if (mddev->bitmap)
|
||||
mddev->thread->timeout = mddev->bitmap->daemon_sleep * HZ;
|
||||
else
|
||||
mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT;
|
||||
md_wakeup_thread(mddev->thread);
|
||||
}
|
||||
}
|
||||
|
||||
static mdk_personality_t raid6_personality=
|
||||
{
|
||||
.name = "raid6",
|
||||
|
Reference in New Issue
Block a user