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.
* 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;
/*
* Analyze all RAID superblock(s)
*/
- if (analyze_sbs(mddev)) {
+ if (!mddev->sb && analyze_sbs(mddev)) {
MD_BUG();
return -EINVAL;
}