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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-05-21 15:37:20 +10:00
parent a88e119f6f
commit 8772113ab2
1 changed files with 2 additions and 1 deletions

View File

@ -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);