]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
super1: make the check for NodeNumUpdate more accurate
authorGuoqing Jiang <gqjiang@suse.com>
Mon, 9 May 2016 02:22:58 +0000 (10:22 +0800)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 9 May 2016 18:59:59 +0000 (14:59 -0400)
We missed to check the version is BITMAP_MAJOR_CLUSTERED
or not, otherwise mdadm can't create array with other 1.x
metadatas (1.0 and 1.1).

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super1.c

index 972b4700455426d47f52141416d873b6c745fa07..fa933676621f6431398192b1c0b26f3ce53deac3 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -2389,7 +2389,7 @@ static int write_bitmap1(struct supertype *st, int fd, enum bitmap_update update
                break;
        case NodeNumUpdate:
                /* cluster md only supports superblock 1.2 now */
-               if (st->minor_version != 2) {
+               if (st->minor_version != 2 && bms->version == BITMAP_MAJOR_CLUSTERED) {
                        pr_err("Warning: cluster md only works with superblock 1.2\n");
                        return -EINVAL;
                }