summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorAdam Kwolek <adam.kwolek@intel.com>2011-10-03 09:26:48 +1100
committerNeilBrown <neilb@suse.de>2011-10-03 09:26:48 +1100
commit2dddadb0f713c5bb335a80518b42c152ef955d27 (patch)
treebe9f6b5523cbfeef79f232f5ba23698093ac2716 /mdadm.c
parentb76b30e0f95008b840849e5f176eaeca20545a9a (diff)
Add continue option to grow command
To allow for reshape continuation '--continue' option is added to grow command. Function that will be executed in grow-continue case doesn't require information about reshape geometry. All required information are read from metadata. For external metadata reshape can be run for monitored array/container only. In case when array/container is not monitored run mdmon for it. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mdadm.c b/mdadm.c
index af182d09..ebf1c46e 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -74,6 +74,7 @@ int main(int argc, char *argv[])
int export = 0;
int assume_clean = 0;
char *symlinks = NULL;
+ int grow_continue = 0;
/* autof indicates whether and how to create device node.
* bottom 3 bits are style. Rest (when shifted) are number of parts
* 0 - unset
@@ -996,6 +997,11 @@ int main(int argc, char *argv[])
backup_file = optarg;
continue;
+ case O(GROW, Continue):
+ /* Continue interrupted grow
+ */
+ grow_continue = 1;
+ continue;
case O(ASSEMBLE, InvalidBackup):
/* Acknowledge that the backupfile is invalid, but ask
* to continue anyway
@@ -1649,7 +1655,11 @@ int main(int argc, char *argv[])
delay = DEFAULT_BITMAP_DELAY;
rv = Grow_addbitmap(devlist->devname, mdfd, bitmap_file,
bitmap_chunk, delay, write_behind, force);
- } else if (size >= 0 || raiddisks != 0 || layout_str != NULL
+ } else if (grow_continue)
+ rv = Grow_continue_command(devlist->devname,
+ mdfd, backup_file,
+ verbose);
+ else if (size >= 0 || raiddisks != 0 || layout_str != NULL
|| chunk != 0 || level != UnSet) {
rv = Grow_reshape(devlist->devname, mdfd, quiet, backup_file,
size, level, layout_str, chunk, raiddisks,