]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
super1: set RESHAPE_NO_BACKUP based on new_offset.
authorNeilBrown <neilb@suse.de>
Mon, 27 May 2013 05:18:07 +0000 (15:18 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 28 May 2013 06:58:18 +0000 (16:58 +1000)
We need to check for a backup iff the data_offset has changed.
Testing against level==10 was an effective but short-sighted approach.

Signed-off-by: NeilBrown <neilb@suse.de>
super1.c

index d92e59455af279d682aebc1db3574e207fe14327..a9ca2169bf486f7f68b6670557c071eebb621cd9 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1006,7 +1006,8 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map)
 
        if (sb->feature_map & __le32_to_cpu(MD_FEATURE_RESHAPE_ACTIVE)) {
                info->reshape_active = 1;
-               if (info->array.level == 10)
+               if ((sb->feature_map & __le32_to_cpu(MD_FEATURE_NEW_OFFSET)) &&
+                   sb->new_offset != 0)
                        info->reshape_active |= RESHAPE_NO_BACKUP;
                info->reshape_progress = __le64_to_cpu(sb->reshape_position);
                info->new_level = __le32_to_cpu(sb->new_level);