On Wed, 09 Mar 2011 14:46:26 +0100 Adam Kwolek <adam.kwolek@xxxxxxxxx> wrote: > When reshape is restarted array (in readonly state) cannot be opened for writing. > For reshape restart open array for reading only. > Array is configured already and no writes are required. > > Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> > --- > > Grow.c | 12 +++++++++++- > 1 files changed, 11 insertions(+), 1 deletions(-) > > diff --git a/Grow.c b/Grow.c > index 67bbb26..e392290 100644 > --- a/Grow.c > +++ b/Grow.c > @@ -2240,7 +2240,17 @@ int reshape_container(char *container, char *devname, > if (!content) > break; > > - fd = open_dev(mdstat->devnum); > + if (restart) { > + char buf[20]; > + /* array is in readonly state, > + * so cannot be opened for writting > + */ > + sprintf(buf, "%d:%d", > + dev2major(mdstat->devnum), > + dev2minor(mdstat->devnum)); > + fd = dev_open(buf, O_RDONLY); > + } else > + fd = open_dev(mdstat->devnum); > if (fd < 0) > break; > adev = map_dev(dev2major(mdstat->devnum), > I changed open_dev to always open O_RDONLY instead. That seems to be quite sufficient. Thanks, NeilBrown -- 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