summaryrefslogtreecommitdiff
path: root/super0.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-02-21 11:41:01 +1100
committerNeilBrown <neilb@suse.de>2011-02-21 11:41:01 +1100
commitd43494fc3c074fc589d928aaf227806437ef530b (patch)
tree8d666932f71a0cfd1a24561785f1802bebe15ebe /super0.c
parent47573b0015943efd0564a6db6fd17fd8a7e76b39 (diff)
downloadmdadm-d43494fc3c074fc589d928aaf227806437ef530b.tar.gz
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 <neilb@suse.de>
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/super0.c b/super0.c
index ae3e885..b141b74 100644
--- a/super0.c
+++ b/super0.c
@@ -491,6 +491,20 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
sb->disks[d].state = info->disk.state | wonly;
rv = 1;
}
+ if (info->reshape_active &&
+ sb->minor_version > 90 && (sb->reshape_position+1) != 0 &&
+ info->delta_disks >= 0 &&
+ info->reshape_progress < sb->reshape_position) {
+ sb->reshape_position = info->reshape_progress;
+ rv = 1;
+ }
+ if (info->reshape_active &&
+ sb->minor_version > 90 && (sb->reshape_position+1) != 0 &&
+ info->delta_disks < 0 &&
+ info->reshape_progress > sb->reshape_position) {
+ sb->reshape_position = info->reshape_progress;
+ rv = 1;
+ }
}
if (strcmp(update, "linear-grow-new") == 0) {
memset(&sb->disks[info->disk.number], 0, sizeof(sb->disks[0]));