From: NeilBrown Date: Tue, 21 May 2013 05:37:20 +0000 (+1000) Subject: Examine/super1: don't report "New Offset" when feature not set. X-Git-Tag: mdadm-3.3-rc1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8772113ab2117a4644bc71b47f16fc91f9a6b283;p=thirdparty%2Fmdadm.git Examine/super1: don't report "New Offset" when feature not set. The "new_offset" field may be non-zero, but if the feature flag is not set, it should be ignored. Signed-off-by: NeilBrown --- diff --git a/super1.c b/super1.c index 89f441fc..08d94a32 100644 --- a/super1.c +++ b/super1.c @@ -327,7 +327,8 @@ static void examine_super1(struct supertype *st, char *homehost) if (sb->data_offset) printf(" Data Offset : %llu sectors\n", (unsigned long long)__le64_to_cpu(sb->data_offset)); - if (sb->new_offset) { + if (sb->new_offset && + (__le32_to_cpu(sb->feature_map) & MD_FEATURE_NEW_OFFSET)) { unsigned long long offset = __le64_to_cpu(sb->data_offset); offset += (signed)(int32_t)__le32_to_cpu(sb->new_offset); printf(" New Offset : %llu sectors\n", offset);