summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-02-04 12:02:09 +1100
committerNeilBrown <neilb@suse.de>2010-02-04 12:02:09 +1100
commit921d9e164fd3f6203d1b0cf2424b793043afd001 (patch)
treead0fa1ec1343bd28676de6907177189ed14a748c /super1.c
parentcc86f89c855fcfe9820d0621ede1575adc317155 (diff)
downloadmdadm-921d9e164fd3f6203d1b0cf2424b793043afd001.tar.gz
mdadm-921d9e164fd3f6203d1b0cf2424b793043afd001.tar.xz
mdadm-921d9e164fd3f6203d1b0cf2424b793043afd001.zip
Assemble: fix --force assembly of v1.x arrays which are recovering.
1.x metadata allows a device to be a member of the array while it is still recoverying. So it is a working member, but is not completely in-sync. mdadm/assemble does not understand this distinction and assumes that a work member is fully in-sync for the purpose of determining if there are enough in-sync devices for the array to be functional. So collect the 'recovery_start' value from the metadata and use it in assemble when determining how useful a given device is. Reported-by: Mikael Abrahamsson <swmike@swm.pp.se> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/super1.c b/super1.c
index 85bb598..40fbb81 100644
--- a/super1.c
+++ b/super1.c
@@ -612,6 +612,11 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info)
strncpy(info->name, sb->set_name, 32);
info->name[32] = 0;
+ if (sb->feature_map & __le32_to_cpu(MD_FEATURE_RECOVERY_OFFSET))
+ info->recovery_start = __le32_to_cpu(sb->recovery_offset);
+ else
+ info->recovery_start = MaxSector;
+
if (sb->feature_map & __le32_to_cpu(MD_FEATURE_RESHAPE_ACTIVE)) {
info->reshape_active = 1;
info->reshape_progress = __le64_to_cpu(sb->reshape_position);