summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-08-10 05:28:24 +0200
committerDan Williams <dan.j.williams@intel.com>2008-08-12 11:25:49 +0200
commita48ac0a8d626bbf1d3bd798a212512402e6ead5e (patch)
tree366418f53775024bb896f365b00b87e57d824720
parentmdmon: use activate spare for re-add (diff)
downloadmdadm-a48ac0a8d626bbf1d3bd798a212512402e6ead5e.tar.xz
mdadm-a48ac0a8d626bbf1d3bd798a212512402e6ead5e.zip
imsm: update mpb_size in write_super_imsm
With dev->vol.map and mpb->disk entries entering and leaving the parameter block write_super_imsm needs to update the size before writeback. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--super-intel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c
index 28b26d98..7ea91917 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -1611,6 +1611,7 @@ static int write_super_imsm(struct intel_super *super, int doclose)
int spares = 0;
int raid_disks = 0;
int i;
+ __u32 mpb_size = sizeof(struct imsm_super) - sizeof(struct imsm_disk);
/* 'generation' is incremented everytime the metadata is written */
generation = __le32_to_cpu(mpb->generation_num);
@@ -1623,6 +1624,7 @@ static int write_super_imsm(struct intel_super *super, int doclose)
else {
raid_disks++;
mpb->disk[d->index] = d->disk;
+ mpb_size += sizeof(struct imsm_disk);
}
}
if (raid_disks != mpb->num_disks) {
@@ -1635,7 +1637,10 @@ static int write_super_imsm(struct intel_super *super, int doclose)
struct imsm_dev *dev = __get_imsm_dev(mpb, i);
imsm_copy_dev(dev, super->dev_tbl[i]);
+ mpb_size += sizeof_imsm_dev(dev, 0);
}
+ mpb_size += __le32_to_cpu(mpb->bbm_log_size);
+ mpb->mpb_size = __cpu_to_le32(mpb_size);
/* recalculate checksum */
sum = __gen_imsm_checksum(mpb);