summaryrefslogtreecommitdiff
path: root/Incremental.c
diff options
context:
space:
mode:
authorAdam Kwolek <adam.kwolek@intel.com>2011-10-03 09:15:22 +1100
committerNeilBrown <neilb@suse.de>2011-10-03 09:15:22 +1100
commitb76b30e0f95008b840849e5f176eaeca20545a9a (patch)
tree239b683f80c488eed2d2e4ccf44d3dbff902b64c /Incremental.c
parentcc700db34f6fb565b37f4edf7fe7fe40a5f2745b (diff)
Do not continue reshape during initrd phase
During initrd phase continuing reshape will cause file system context lost. This blocks ability to control reshape using checkpoints. To avoid this, during initrd phase assemble has to be executed with '--freeze-reshape' option. This causes that mdadm restores reshape critical section only. Reshape can be continued later after system full boot. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/Incremental.c b/Incremental.c
index a3e05a7c..b90089bb 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -44,7 +44,8 @@ static int try_spare(char *devname, int *dfdp, struct dev_policy *pol,
static int Incremental_container(struct supertype *st, char *devname,
char *homehost,
- int verbose, int runstop, int autof);
+ int verbose, int runstop, int autof,
+ int freeze_reshape);
static struct mddev_ident *search_mdstat(struct supertype *st,
struct mdinfo *info,
@@ -53,7 +54,7 @@ static struct mddev_ident *search_mdstat(struct supertype *st,
int Incremental(char *devname, int verbose, int runstop,
struct supertype *st, char *homehost, int require_homehost,
- int autof)
+ int autof, int freeze_reshape)
{
/* Add this device to an array, creating the array if necessary
* and starting the array if sensible or - if runstop>0 - if possible.
@@ -140,7 +141,8 @@ int Incremental(char *devname, int verbose, int runstop,
close(dfd);
if (!rv && st->ss->container_content)
return Incremental_container(st, devname, homehost,
- verbose, runstop, autof);
+ verbose, runstop, autof,
+ freeze_reshape);
fprintf(stderr, Name ": %s is not part of an md array.\n",
devname);
@@ -450,7 +452,8 @@ int Incremental(char *devname, int verbose, int runstop,
close(mdfd);
sysfs_free(sra);
rv = Incremental(chosen_name, verbose, runstop,
- NULL, homehost, require_homehost, autof);
+ NULL, homehost, require_homehost, autof,
+ freeze_reshape);
if (rv == 1)
/* Don't fail the whole -I if a subarray didn't
* have enough devices to start yet
@@ -1416,7 +1419,7 @@ static char *container2devname(char *devname)
static int Incremental_container(struct supertype *st, char *devname,
char *homehost, int verbose,
- int runstop, int autof)
+ int runstop, int autof, int freeze_reshape)
{
/* Collect the contents of this container and for each
* array, choose a device name and assemble the array.
@@ -1554,7 +1557,8 @@ static int Incremental_container(struct supertype *st, char *devname,
}
assemble_container_content(st, mdfd, ra, runstop,
- chosen_name, verbose, NULL);
+ chosen_name, verbose, NULL,
+ freeze_reshape);
close(mdfd);
}