On Fri, 16 Sep 2011 13:54:48 +0200 Adam Kwolek <adam.kwolek@xxxxxxxxx> wrote: > When reshape was invoked during initramfs start-up stage > array is pushed in to reshape state already, so read only > state cannot be set again. To verify if reshape continuation should > be allowed sync_action sysfs key is tested and number of existing mdadm > instances is checked again. > > Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> Again, it is not at all clear to me what you are trying to protect against here... The "set_str ... readonly" is going to need to be changed. In the normal case, this is where the array is activated, but it is activated read-only to ensure no reshape automatically starts. In the --continue case it is already running and reshape is suspended, so there is no need to set it to readonly when Grow_continue is called from Grow_continue_command. NeilBrown > --- > > Grow.c | 19 +++++++++++++++++-- > 1 files changed, 17 insertions(+), 2 deletions(-) > > diff --git a/Grow.c b/Grow.c > index 4d2c361..b331287 100644 > --- a/Grow.c > +++ b/Grow.c > @@ -3714,8 +3714,23 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info, > int err; > > err = sysfs_set_str(info, NULL, "array_state", "readonly"); > - if (err) > - return err; > + if (err) { > + /* check if array is set in to reshape stare, > + * and current mdadm instance is the only one > + */ > + if ((sysfs_get_str(info, NULL, "sync_action", > + buf, 40) == 8) && > + (count_mdadms() == 1)) { > + dprintf("Warning: Grow_continue() cannot set array in" > + "to read only state [sync_action is %s].", > + buf); > + if (strncmp(buf, "reshape", 7)) > + return err; > + dprintf("Allow to continue.\n"); > + } else > + return err; > + } > + > if (st->ss->external) { > fmt_devname(buf, st->container_dev); > container = buf; > > -- > To unsubscribe from this list: send the line "unsubscribe linux-raid" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html
Attachment:
signature.asc
Description: PGP signature