You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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
+9
-7
@@ -2054,13 +2054,15 @@ static int do_md_run(mddev_t * mddev)
|
||||
if (start_readonly)
|
||||
mddev->ro = 2; /* read-only, but switch on first write */
|
||||
|
||||
/* before we start the array running, initialise the bitmap */
|
||||
err = bitmap_create(mddev);
|
||||
if (err)
|
||||
printk(KERN_ERR "%s: failed to create bitmap (%d)\n",
|
||||
mdname(mddev), err);
|
||||
else
|
||||
err = mddev->pers->run(mddev);
|
||||
err = mddev->pers->run(mddev);
|
||||
if (!err && mddev->pers->sync_request) {
|
||||
err = bitmap_create(mddev);
|
||||
if (err) {
|
||||
printk(KERN_ERR "%s: failed to create bitmap (%d)\n",
|
||||
mdname(mddev), err);
|
||||
mddev->pers->stop(mddev);
|
||||
}
|
||||
}
|
||||
if (err) {
|
||||
printk(KERN_ERR "md: pers->run() failed ...\n");
|
||||
module_put(mddev->pers->owner);
|
||||
|
||||
Reference in New Issue
Block a user