diff options
author | NeilBrown <neilb@suse.de> | 2013-05-23 07:48:48 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-05-28 08:44:23 +0200 |
commit | 199f1a1fadcd0fb5efba656ad92a44c51f8cc8ea (patch) | |
tree | 5f85a1db5fb927b5a33643c621ff64f60ffb4c3f /super0.c | |
parent | Assemble: --update=metadata converts v0.90 to v1.0 (diff) | |
download | mdadm-199f1a1fadcd0fb5efba656ad92a44c51f8cc8ea.tar.xz mdadm-199f1a1fadcd0fb5efba656ad92a44c51f8cc8ea.zip |
Assemble: allow --update=revert-reshape
This will cause a reshape to start going backwards.
Diffstat (limited to 'super0.c')
-rw-r--r-- | super0.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -645,6 +645,28 @@ static int update_super0(struct supertype *st, struct mdinfo *info, uuid_from_super0(st, info->uuid); st->other = super1_make_v0(st, info, st->sb); } + } else if (strcmp(update, "revert-reshape") == 0) { + rv = -2; + if (sb->minor_version <= 90) + pr_err("No active reshape to revert on %s\n", + devname); + else if (sb->delta_disks == 0) + pr_err("%s: Can on revert reshape which changes number of devices\n", + devname); + else { + int tmp; + rv = 0; + sb->raid_disks -= sb->delta_disks; + sb->delta_disks = -sb->delta_disks; + + tmp = sb->new_layout; + sb->new_layout = sb->layout; + sb->layout = tmp; + + tmp = sb->new_chunk; + sb->new_chunk = sb->chunk_size; + sb->chunk_size = tmp; + } } else if (strcmp(update, "no-bitmap") == 0) { sb->state &= ~(1<<MD_SB_BITMAP_PRESENT); } else if (strcmp(update, "_reshape_progress")==0) |