summaryrefslogtreecommitdiff
path: root/super1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-06-19 16:28:05 +1000
committerNeilBrown <neilb@suse.de>2013-06-19 16:28:05 +1000
commitccec2685ab551182dac21c481c7e26ce77931a11 (patch)
tree3356e4f6baf5156a23b6bab0d9edbd99bd273860 /super1.c
parent033e098c070e5c9ddbd321bda7a17988426dbe04 (diff)
Add test for --update=metadata and fix bug it found.
We were not setting device size correctly for raid0. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/super1.c b/super1.c
index 918357ce..16dfd389 100644
--- a/super1.c
+++ b/super1.c
@@ -2320,7 +2320,10 @@ void *super1_make_v0(struct supertype *st, struct mdinfo *info, mdp_super_t *sb0
sb->size = __cpu_to_le64(info->component_size);
sb->chunksize = __cpu_to_le32(info->array.chunk_size/512);
sb->raid_disks = __cpu_to_le32(info->array.raid_disks);
- sb->data_size = sb->size;
+ if (info->array.level > 0)
+ sb->data_size = sb->size;
+ else
+ sb->data_size = st->ss->avail_size(st, st->devsize/512, 0);
sb->resync_offset = MaxSector;
sb->max_dev = __cpu_to_le32(MD_SB_DISKS);
sb->dev_number = __cpu_to_le32(info->disk.number);