aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-01-06 03:20:16 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:34:03 -0500
commitb15c2e57f0f5bf596a19e9c5571e5b07cdfc7363 (patch)
treeda68e3ed72e59212936daf7dd4c86f1f9a7ab386 /drivers/md/md.c
parent6ff8d8ec06690f4011a6c3ad9e0759b9094f0601 (diff)
[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>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b4fb7247b3ed..ee199d462520 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2054,13 +2054,15 @@ static int do_md_run(mddev_t * mddev)
2054 if (start_readonly) 2054 if (start_readonly)
2055 mddev->ro = 2; /* read-only, but switch on first write */ 2055 mddev->ro = 2; /* read-only, but switch on first write */
2056 2056
2057 /* before we start the array running, initialise the bitmap */ 2057 err = mddev->pers->run(mddev);
2058 err = bitmap_create(mddev); 2058 if (!err && mddev->pers->sync_request) {
2059 if (err) 2059 err = bitmap_create(mddev);
2060 printk(KERN_ERR "%s: failed to create bitmap (%d)\n", 2060 if (err) {
2061 mdname(mddev), err); 2061 printk(KERN_ERR "%s: failed to create bitmap (%d)\n",
2062 else 2062 mdname(mddev), err);
2063 err = mddev->pers->run(mddev); 2063 mddev->pers->stop(mddev);
2064 }
2065 }
2064 if (err) { 2066 if (err) {
2065 printk(KERN_ERR "md: pers->run() failed ...\n"); 2067 printk(KERN_ERR "md: pers->run() failed ...\n");
2066 module_put(mddev->pers->owner); 2068 module_put(mddev->pers->owner);