From d43494fc3c074fc589d928aaf227806437ef530b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 21 Feb 2011 11:41:01 +1100 Subject: Teach --assemble --force to handle reshapes a little better. When we force-assemble an array which is in the middle of a reshape, we should repeat the reshape of any parts that aren't recorded in the oldest superblock. This is unlikely to make a significant difference, but could make a small difference, and is safer. Signed-off-by: NeilBrown --- super1.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'super1.c') diff --git a/super1.c b/super1.c index 0eb03230..e8f59c6a 100644 --- a/super1.c +++ b/super1.c @@ -680,6 +680,20 @@ static int update_super1(struct supertype *st, struct mdinfo *info, sb->dev_roles[d] = __cpu_to_le16(want); rv = 1; } + if (info->reshape_active && + sb->feature_map & __le32_to_cpu(MD_FEATURE_RESHAPE_ACTIVE) && + info->delta_disks >= 0 && + info->reshape_progress < __le64_to_cpu(sb->reshape_position)) { + sb->reshape_position = __cpu_to_le64(info->reshape_progress); + rv = 1; + } + if (info->reshape_active && + sb->feature_map & __le32_to_cpu(MD_FEATURE_RESHAPE_ACTIVE) && + info->delta_disks < 0 && + info->reshape_progress > __le64_to_cpu(sb->reshape_position)) { + sb->reshape_position = __cpu_to_le64(info->reshape_progress); + rv = 1; + } } if (strcmp(update, "linear-grow-new") == 0) { unsigned int i; -- cgit v1.2.3 From 1f9476aaf86cb465566b5a1cd5a2fb493531c2eb Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 30 Nov 2010 16:46:01 +1100 Subject: Assemble: add --update=no-bitmap This allows an array with a corrupt internal bitmap to be assembled without the bitmap. Signed-off-by: NeilBrown --- super1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'super1.c') diff --git a/super1.c b/super1.c index e8f59c6a..457e2d6e 100644 --- a/super1.c +++ b/super1.c @@ -643,8 +643,9 @@ static int update_super1(struct supertype *st, struct mdinfo *info, char *devname, int verbose, int uuid_set, char *homehost) { - /* NOTE: for 'assemble' and 'force' we need to return non-zero if any change was made. - * For others, the return value is ignored. + /* NOTE: for 'assemble' and 'force' we need to return non-zero + * if any change was made. For others, the return value is + * ignored. */ int rv = 0; struct mdp_superblock_1 *sb = st->sb; @@ -755,6 +756,8 @@ static int update_super1(struct supertype *st, struct mdinfo *info, bm = (struct bitmap_super_s*)(st->sb+1024); memcpy(bm->uuid, sb->set_uuid, 16); } + } else if (strcmp(update, "no-bitmap") == 0) { + sb->feature_map &= ~__cpu_to_le32(MD_FEATURE_BITMAP_OFFSET); } if (strcmp(update, "homehost") == 0 && homehost) { -- cgit v1.2.3