Commit 376163df authored by Neil Brown's avatar Neil Brown Committed by Trond Myklebust

[PATCH] MD - Don't "analyze_sb" when creating new array.

Don't "analyze_sb" when creating new array.

When creating a new array (and we have an mddev->sb),
don't both to analyze the superblocks.  There is no point.
Also, these means we always allocate the array sb in
analyze_sbs, rather than conditionally.
parent e3de153e
......@@ -1143,9 +1143,8 @@ static int analyze_sbs(mddev_t * mddev)
* find the freshest superblock, that one will be the superblock
* that represents the whole array.
*/
if (!mddev->sb)
if (alloc_array_sb(mddev))
goto abort;
if (alloc_array_sb(mddev))
goto abort;
sb = mddev->sb;
freshest = NULL;
......@@ -1562,7 +1561,7 @@ static int do_md_run(mddev_t * mddev)
/*
* Analyze all RAID superblock(s)
*/
if (analyze_sbs(mddev)) {
if (!mddev->sb && analyze_sbs(mddev)) {
MD_BUG();
return -EINVAL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment