]> git.hungrycats.org Git - linux/commitdiff
[PATCH] MD - Don't "analyze_sb" when creating new array.
authorNeil Brown <neilb@cse.unsw.edu.au>
Fri, 19 Jul 2002 02:07:14 +0000 (19:07 -0700)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Fri, 19 Jul 2002 02:07:14 +0000 (19:07 -0700)
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.

drivers/md/md.c

index 7df31c2d5a5712d6873611f8acb2ae7efd9372e7..e77d616465080b0a40c995117d7f4acd6844304f 100644 (file)
@@ -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;
        }