diff options
author | NeilBrown <neilb@suse.de> | 2014-03-26 14:19:43 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-03-26 14:19:43 +1100 |
commit | eba2859f50bc0de6da7938a9ec6cfe4ceef43874 (patch) | |
tree | 20ad5e554511fad444638b9baf37a3cc6700e3a1 /super-ddf.c | |
parent | 76d0f1886fdef89891d617df7e7f3fde89a38e1a (diff) | |
download | mdadm-eba2859f50bc0de6da7938a9ec6cfe4ceef43874.tar.gz |
DDF: report seq counter as events.
Also don't treat two devices with different seq numbers as completely
unrelated.
This allows split-brain detection to work properly for ddf.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/super-ddf.c b/super-ddf.c index 4242af8..8c67bab 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1928,6 +1928,8 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info, char *m info->disk.state = (1 << MD_DISK_SYNC) | (1 << MD_DISK_ACTIVE); else info->disk.state = 1 << MD_DISK_FAULTY; + + info->events = be32_to_cpu(ddf->active->seq); } else { info->disk.number = -1; info->disk.raid_disk = -1; @@ -2028,6 +2030,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha (be16_to_cpu(ddf->phys->entries[info->disk.number].state) & DDF_Online) && !(be16_to_cpu(ddf->phys->entries[info->disk.number].state) & DDF_Failed)) info->disk.state = (1<<MD_DISK_SYNC)|(1<<MD_DISK_ACTIVE); + info->events = be32_to_cpu(ddf->active->seq); } info->container_member = ddf->currentconf->vcnum; @@ -3840,7 +3843,7 @@ static struct mdinfo *container_content_ddf(struct supertype *st, char *subarray dev->disk.state = (1<<MD_DISK_SYNC)|(1<<MD_DISK_ACTIVE); dev->recovery_start = MaxSector; - dev->events = be32_to_cpu(ddf->primary.seq); + dev->events = be32_to_cpu(ddf->active->seq); dev->data_offset = be64_to_cpu(LBA_OFFSET(ddf, bvd)[iphys]); dev->component_size = be64_to_cpu(bvd->blocks); @@ -3927,12 +3930,6 @@ 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->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 || !be16_eq(first->phys->used_pdes, second->phys->used_pdes) || !be16_eq(first->virt->populated_vdes, |