summaryrefslogtreecommitdiff
path: root/super-ddf.c
diff options
context:
space:
mode:
authormwilck@arcor.de <mwilck@arcor.de>2013-09-14 22:47:12 +0200
committerNeilBrown <neilb@suse.de>2013-10-16 15:29:43 +1100
commit7039479987745f19b166b1c28d45dfc41420e6d9 (patch)
tree71bd653964dd808d23913a768449a40b1c628a53 /super-ddf.c
parentaa0faa10b2ba251f6f543f3a283230c33b13f66d (diff)
DDF: compare_super_ddf: fix sequence number check
The sequence number check in compare_super_ddf was broken, anchor sequence number is always -1. With this patch, mdadm will refuse to add a disk with non-matching sequence number. This fixes Francis Moreau's problem reported with subject "mdadm 3.3 fails to kick out non fresh disk". FIXME: More work is needed here. Currently mdadm won't even add the disk to the container, that's wrong. It should be added as a spare. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/super-ddf.c b/super-ddf.c
index 3673cb33..002b2717 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -3892,10 +3892,10 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst)
if (memcmp(first->anchor.guid, second->anchor.guid, DDF_GUID_LEN) != 0)
return 2;
- if (!be32_eq(first->anchor.seq, second->anchor.seq)) {
- dprintf("%s: sequence number mismatch %u/%u\n", __func__,
- be32_to_cpu(first->anchor.seq),
- be32_to_cpu(second->anchor.seq));
+ if (!be32_eq(first->active->seq, second->active->seq)) {
+ dprintf("%s: sequence number mismatch %u<->%u\n", __func__,
+ be32_to_cpu(first->active->seq),
+ be32_to_cpu(second->active->seq));
return 3;
}
if (first->max_part != second->max_part ||