[PATCH 0/7] Grow_continue, use in assembly (cont.)

[PATCH 0/7] Grow_continue, use in assembly (cont.)

am 01.03.2011 15:56:41 von adam.kwolek

The following series implements next part of resuming reshape from checkpoint.
In this series call to invoke reshape is included.
It is required to have backup file to run reshape, so backup file validation is added
(without checking in file system)
Array seams to be configured for reshape, monitor is blocked and doesn't makes changes
to process. On the end of reshape monitor unblock is placed also.

In patch:
Continue reshape after assembling array
some plans for supporting container operations is placed.

Reshape restoring is not working yet (a few more pathes are still required)
I hope some of therm I'll post tomorrow.

BR
Adam

---

Adam Kwolek (7):
FIX: array is frozen after reshape
Continue reshape after assembling array
FIX: Block monitor when starting array with reshape in progress
Add block_subarray()
FIX: configure disks slot for expansion
FIX: reshape in md should wait for monitoring process (external metadata)
FIX: Verify Backup file name before reshape


Assemble.c | 64 +++++++++++++++++++++++++++++++++++++++++++++------------
Grow.c | 15 ++++++++++++-
Incremental.c | 1 +
msg.c | 18 ++++++++++++----
msg.h | 2 ++
5 files changed, 81 insertions(+), 19 deletions(-)

--
Signature
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 1/7] FIX: Verify Backup file name before reshape

am 01.03.2011 15:56:50 von adam.kwolek

When reshape is continued backup_file is required for user data safety.
Grow_continue() has to verify if any file name is passed in.

Signed-off-by: Adam Kwolek
---

Grow.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Grow.c b/Grow.c
index 47b8809..1470a91 100644
--- a/Grow.c
+++ b/Grow.c
@@ -3332,6 +3332,11 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
char *container = NULL;
int err;

+ if (backup_file == NULL) {
+ fprintf(stderr, Name ": Backup file name has to be specified "
+ "for reshape continuation.\n");
+ return 1;
+ }
if (!st->ss->external) {
err = sysfs_set_str(info, NULL, "array_state", "readonly");
if (err)

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/7] FIX: reshape in md should wait for monitoring process

am 01.03.2011 15:56:58 von adam.kwolek

When container content is assembled it is possible that reshape
is in progress. To avoid md to run reshape without monitoring.
Before setting array parameters sync_max is set to 0, to not allow md
for any move forward. After array parameters are set, sync_max is set to current
reshape_progress. This is current reshape start point.
Note that md is still blocked, and reshape is not continued.

Signed-off-by: Adam Kwolek
---

Assemble.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index 4d41081..6aff049 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1510,11 +1510,26 @@ int assemble_container_content(struct supertype *st, int mdfd,
sysfs_init(content, mdfd, 0);

sra = sysfs_read(mdfd, 0, GET_VERSION);
- if (sra == NULL || strcmp(sra->text_version, content->text_version) != 0)
+ if (sra == NULL || strcmp(sra->text_version,
+ content->text_version) != 0) {
+ if (content->reshape_active) {
+ /* block reshape until reshape monitoring
+ * allows for run
+ */
+ sysfs_set_num(content, NULL, "sync_max", 0);
+ }
if (sysfs_set_array(content, md_get_version(mdfd)) != 0) {
close(mdfd);
return 1;
}
+ if (content->reshape_active) {
+ /* set the current checkpoint to allow monitoring to
+ * restart reshape
+ */
+ sysfs_set_num(content, NULL, "sync_max",
+ content->reshape_progress);
+ }
+ }
if (sra)
sysfs_free(sra);


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 3/7] FIX: configure disks slot for expansion

am 01.03.2011 15:57:06 von adam.kwolek

Some raid_disks that are used for expansion, are not configured yet.
This is due to earlier set raid_disks limitation.
Set raid_disks to new (bigger) value and finish disks slot configuration.

Signed-off-by: Adam Kwolek
---

Assemble.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index 6aff049..fa3a0a6 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1586,9 +1586,22 @@ int assemble_container_content(struct supertype *st, int mdfd,
chosen_name, working + preexist);
if (preexist)
fprintf(stderr, " (%d new)", working);
- if (expansion)
+ if (expansion) {
fprintf(stderr, " ( + %d for expansion)",
expansion);
+ sysfs_set_num(content, NULL, "raid_disks",
+ content->array.raid_disks + expansion);
+ for (dev = content->devs; dev; dev = dev->next)
+ if (dev->disk.raid_disk >=
+ content->array.raid_disks) {
+ int rv;
+ dprintf("\n\tExpansion: configure slot:"
+ "%i", dev->disk.raid_disk);
+ rv = sysfs_set_num(content, dev, "slot",
+ dev->disk.raid_disk);
+ dprintf(" (status = %i)\n", rv);
+ }
+ }
fprintf(stderr, "\n");
}
if (!err)

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 4/7] Add block_subarray()

am 01.03.2011 15:57:15 von adam.kwolek

Put code for blocking subarray in to separate function.
This little code/function will be used for blocking arrays from mdmon
monitoring during assembly process. Arrays cannot wait for container
assembly finish, because meanwhile monitor can enable arrays for writing.

Signed-off-by: Adam Kwolek
---

msg.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/msg.c b/msg.c
index 76e74e7..ce2ce00 100644
--- a/msg.c
+++ b/msg.c
@@ -255,6 +255,18 @@ static int unblock_subarray(struct mdinfo *sra, const int unfreeze)
return rc;
}

+int block_subarray(struct mdinfo *sra)
+{
+ char buf[64];
+ int rc = 0;
+
+ sprintf(buf, "external:%s\n", sra->text_version);
+ buf[9] = '-';
+ if (sysfs_set_str(sra, NULL, "metadata_version", buf))
+ rc = -1;
+
+ return rc;
+}
/**
* block_monitor - prevent mdmon spare assignment
* @container - container to block
@@ -334,9 +346,7 @@ int block_monitor(char *container, const int freeze)
* takeover in reshape case and spare reassignment in the
* auto-rebuild case)
*/
- sprintf(buf, "external:%s\n", sra->text_version);
- buf[9] = '-';
- if (sysfs_set_str(sra, NULL, "metadata_version", buf))
+ if (block_subarray(sra))
break;
ping_monitor(container);


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 5/7] FIX: Block monitor when starting array with reshape in

am 01.03.2011 15:57:23 von adam.kwolek

To allow for array reconfiguration, mdmon cannot push array in to active
state. Assemble should block monitor for external metadata to allow
for reshape configuration and restart.

Signed-off-by: Adam Kwolek
---

Assemble.c | 2 ++
msg.h | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index fa3a0a6..9d17a57 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1528,8 +1528,10 @@ int assemble_container_content(struct supertype *st, int mdfd,
*/
sysfs_set_num(content, NULL, "sync_max",
content->reshape_progress);
+ block_subarray(content);
}
}
+
if (sra)
sysfs_free(sra);

diff --git a/msg.h b/msg.h
index 1f916de..090d3f6 100644
--- a/msg.h
+++ b/msg.h
@@ -27,6 +27,7 @@ extern int ack(int fd, int tmo);
extern int wait_reply(int fd, int tmo);
extern int connect_monitor(char *devname);
extern int ping_monitor(char *devname);
+extern int block_subarray(struct mdinfo *sra);
extern int block_monitor(char *container, const int freeze);
extern void unblock_monitor(char *container, const int unfreeze);
extern int fping_monitor(int sock);

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 6/7] Continue reshape after assembling array

am 01.03.2011 15:57:31 von adam.kwolek

assemble_container_content() cannot close mdfd handle, as it could be
required by reshape continuation.
mdfd handle is closed outside this function, when it is not longer necessary.
Call to Grow_continue is added for reshape continuation after assembly.

In the nearest future, simple condition:
if (content->reshape_active)
before Grow_continue() call will be replaced by check function
for support container operation /reshape/.
Additional call to the same check function will be added inside Grow_continue()
after fork command, to find out if reshape pointed by metadata applies to current array
or we should wait for it (another array is under reshape).

Signed-off-by: Adam Kwolek

Conflicts:

Assemble.c
---

Assemble.c | 32 ++++++++++++++++++++------------
Incremental.c | 1 +
2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index 9d17a57..c3d8914 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -696,8 +696,21 @@ int Assemble(struct supertype *st, char *mddev,
#ifndef MDASSEMBLE
if (content != &info) {
/* This is a member of a container. Try starting the array. */
- return assemble_container_content(st, mdfd, content, runstop,
- chosen_name, verbose);
+ int err;
+ err = assemble_container_content(st, mdfd, content, runstop,
+ chosen_name, verbose);
+ if (!err) {
+ /* check if reshape of external metadata
+ * is in progress
+ * and it is need to be monitored by mdadm
+ */
+ if (content->reshape_active)
+ err = Grow_continue(mdfd, st, content,
+ backup_file);
+ }
+ close(mdfd);
+
+ return err;
}
#endif
/* Ok, no bad inconsistancy, we can try updating etc */
@@ -1518,10 +1531,9 @@ int assemble_container_content(struct supertype *st, int mdfd,
*/
sysfs_set_num(content, NULL, "sync_max", 0);
}
- if (sysfs_set_array(content, md_get_version(mdfd)) != 0) {
- close(mdfd);
+ if (sysfs_set_array(content, md_get_version(mdfd)) != 0)
return 1;
- }
+
if (content->reshape_active) {
/* set the current checkpoint to allow monitoring to
* restart reshape
@@ -1543,11 +1555,9 @@ int assemble_container_content(struct supertype *st, int mdfd,
else if (dev->disk.raid_disk >= content->array.raid_disks &&
content->reshape_active)
expansion++;
- if (working == 0) {
- close(mdfd);
+ if (working == 0)
return 1;/* Nothing new, don't try to start */
- }
-
+
map_update(&map, fd2devnum(mdfd),
content->text_version,
content->uuid, chosen_name);
@@ -1608,8 +1618,7 @@ int assemble_container_content(struct supertype *st, int mdfd,
}
if (!err)
wait_for(chosen_name, mdfd);
- close(mdfd);
- return 0;
+ return err;
/* FIXME should have an O_EXCL and wait for read-auto */
} else {
if (verbose >= 0)
@@ -1617,7 +1626,6 @@ int assemble_container_content(struct supertype *st, int mdfd,
": %s assembled with %d devices but "
"not started\n",
chosen_name, working);
- close(mdfd);
return 1;
}
}
diff --git a/Incremental.c b/Incremental.c
index 4c4b0c7..91359f4 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1556,6 +1556,7 @@ static int Incremental_container(struct supertype *st, char *devname,

assemble_container_content(st, mdfd, ra, runstop,
chosen_name, verbose);
+ close(mdfd);
}

/* Now move all suitable spares from spare container */

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 7/7] FIX: array is frozen after reshape

am 01.03.2011 15:57:39 von adam.kwolek

When we fork() process, we do not need another fork inside reshape_array().
We can indicate it by fork flag.
In such case Grow_continue() is responsible for unfreezing array
after return from reshape_array() function.

Signed-off-by: Adam Kwolek
---

Grow.c | 10 ++++++++--
msg.c | 2 +-
msg.h | 1 +
3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Grow.c b/Grow.c
index 1470a91..fc90aa5 100644
--- a/Grow.c
+++ b/Grow.c
@@ -3331,6 +3331,7 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
char buf[40];
char *container = NULL;
int err;
+ int forked = 0;

if (backup_file == NULL) {
fprintf(stderr, Name ": Backup file name has to be specified "
@@ -3354,11 +3355,16 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
case 0:
dprintf(Name ": Continue bacground reshape "
"after assemblation\n");
+ forked = 1;
}
}

- return reshape_array(container, mdfd, "array", st, info, 1,
- backup_file, 0, 0, 1);
+ err = reshape_array(container, mdfd, "array", st, info, 1,
+ backup_file, 0, forked, 1);
+ if (forked)
+ unblock_subarray(info, 0);
+
+ return err;
}


diff --git a/msg.c b/msg.c
index ce2ce00..a1f4bc6 100644
--- a/msg.c
+++ b/msg.c
@@ -235,7 +235,7 @@ static char *ping_monitor_version(char *devname)
return msg.buf;
}

-static int unblock_subarray(struct mdinfo *sra, const int unfreeze)
+int unblock_subarray(struct mdinfo *sra, const int unfreeze)
{
char buf[64];
int rc = 0;
diff --git a/msg.h b/msg.h
index 090d3f6..91a7798 100644
--- a/msg.h
+++ b/msg.h
@@ -28,6 +28,7 @@ extern int wait_reply(int fd, int tmo);
extern int connect_monitor(char *devname);
extern int ping_monitor(char *devname);
extern int block_subarray(struct mdinfo *sra);
+extern int unblock_subarray(struct mdinfo *sra, const int unfreeze);
extern int block_monitor(char *container, const int freeze);
extern void unblock_monitor(char *container, const int unfreeze);
extern int fping_monitor(int sock);

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/7] FIX: Verify Backup file name before reshape

am 02.03.2011 02:01:33 von NeilBrown

On Tue, 01 Mar 2011 15:56:50 +0100 Adam Kwolek wrote:

> When reshape is continued backup_file is required for user data safety.
> Grow_continue() has to verify if any file name is passed in.
>
> Signed-off-by: Adam Kwolek
> ---
>
> Grow.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/Grow.c b/Grow.c
> index 47b8809..1470a91 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -3332,6 +3332,11 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
> char *container = NULL;
> int err;
>
> + if (backup_file == NULL) {
> + fprintf(stderr, Name ": Backup file name has to be specified "
> + "for reshape continuation.\n");
> + return 1;
> + }
> if (!st->ss->external) {
> err = sysfs_set_str(info, NULL, "array_state", "readonly");
> if (err)


reshape_array already performs checks to ensure that backup_file is set when
needed - it isn't always needed.

Is there some reason those checks are not enough?

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/7] FIX: reshape in md should wait for monitoringprocess (external metadata)

am 02.03.2011 02:06:03 von NeilBrown

On Tue, 01 Mar 2011 15:56:58 +0100 Adam Kwolek wrote:

> When container content is assembled it is possible that reshape
> is in progress. To avoid md to run reshape without monitoring.
> Before setting array parameters sync_max is set to 0, to not allow md
> for any move forward. After array parameters are set, sync_max is set to current
> reshape_progress. This is current reshape start point.
> Note that md is still blocked, and reshape is not continued.
>
> Signed-off-by: Adam Kwolek
> ---
>
> Assemble.c | 17 ++++++++++++++++-
> 1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/Assemble.c b/Assemble.c
> index 4d41081..6aff049 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -1510,11 +1510,26 @@ int assemble_container_content(struct supertype *st, int mdfd,
> sysfs_init(content, mdfd, 0);
>
> sra = sysfs_read(mdfd, 0, GET_VERSION);
> - if (sra == NULL || strcmp(sra->text_version, content->text_version) != 0)
> + if (sra == NULL || strcmp(sra->text_version,
> + content->text_version) != 0) {
> + if (content->reshape_active) {
> + /* block reshape until reshape monitoring
> + * allows for run
> + */
> + sysfs_set_num(content, NULL, "sync_max", 0);
> + }
> if (sysfs_set_array(content, md_get_version(mdfd)) != 0) {
> close(mdfd);
> return 1;
> }
> + if (content->reshape_active) {
> + /* set the current checkpoint to allow monitoring to
> + * restart reshape
> + */
> + sysfs_set_num(content, NULL, "sync_max",
> + content->reshape_progress);
> + }
> + }
> if (sra)
> sysfs_free(sra);
>


I fairly sure this is completely ineffective.

At this point the array has not been started, so 'sync_max' does not exist.
It doesn't appear until the array is activated.

We avoid restart starting early by assembling the array 'readonly' as reshape
cannot progress on a read-only array.

NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 3/7] FIX: configure disks slot for expansion

am 02.03.2011 02:10:01 von NeilBrown

On Tue, 01 Mar 2011 15:57:06 +0100 Adam Kwolek wrote:

> Some raid_disks that are used for expansion, are not configured yet.
> This is due to earlier set raid_disks limitation.
> Set raid_disks to new (bigger) value and finish disks slot configuration.
>
> Signed-off-by: Adam Kwolek
> ---
>
> Assemble.c | 15 ++++++++++++++-
> 1 files changed, 14 insertions(+), 1 deletions(-)
>
> diff --git a/Assemble.c b/Assemble.c
> index 6aff049..fa3a0a6 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -1586,9 +1586,22 @@ int assemble_container_content(struct supertype *st, int mdfd,
> chosen_name, working + preexist);
> if (preexist)
> fprintf(stderr, " (%d new)", working);
> - if (expansion)
> + if (expansion) {
> fprintf(stderr, " ( + %d for expansion)",
> expansion);
> + sysfs_set_num(content, NULL, "raid_disks",
> + content->array.raid_disks + expansion);
> + for (dev = content->devs; dev; dev = dev->next)
> + if (dev->disk.raid_disk >=
> + content->array.raid_disks) {
> + int rv;
> + dprintf("\n\tExpansion: configure slot:"
> + "%i", dev->disk.raid_disk);
> + rv = sysfs_set_num(content, dev, "slot",
> + dev->disk.raid_disk);
> + dprintf(" (status = %i)\n", rv);
> + }
> + }
> fprintf(stderr, "\n");
> }
> if (!err)


I thought I explained how this was suppose to work....

1/ Set the 'old' geometry of the array. sysfs_set_array does this.
2/ Set 'reshape_position'. sysfs_set_array does this.
3/ Set the 'new' geometry of the array. sysfs_set_array should do this but
it doesn't.
4/ Add all the disks. Repeated calls to sysfs_add_disk will do this.
5/ start the array readonly . assemble_container_content calls sysfs_set_str
to do this.

That is all.

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 0/7] Grow_continue, use in assembly (cont.)

am 02.03.2011 02:30:32 von NeilBrown

On Tue, 01 Mar 2011 15:56:41 +0100 Adam Kwolek wrote:

> The following series implements next part of resuming reshape from checkpoint.
> In this series call to invoke reshape is included.
> It is required to have backup file to run reshape, so backup file validation is added
> (without checking in file system)
> Array seams to be configured for reshape, monitor is blocked and doesn't makes changes
> to process. On the end of reshape monitor unblock is placed also.
>
> In patch:
> Continue reshape after assembling array
> some plans for supporting container operations is placed.
>
> Reshape restoring is not working yet (a few more pathes are still required)
> I hope some of therm I'll post tomorrow.
>
> BR
> Adam
>
> ---
>
> Adam Kwolek (7):
> FIX: array is frozen after reshape
> Continue reshape after assembling array
> FIX: Block monitor when starting array with reshape in progress
> Add block_subarray()
> FIX: configure disks slot for expansion
> FIX: reshape in md should wait for monitoring process (external metadata)
> FIX: Verify Backup file name before reshape
>
>
> Assemble.c | 64 +++++++++++++++++++++++++++++++++++++++++++++------------
> Grow.c | 15 ++++++++++++-
> Incremental.c | 1 +
> msg.c | 18 ++++++++++++----
> msg.h | 2 ++
> 5 files changed, 81 insertions(+), 19 deletions(-)
>


I have applied the patches among these which make sense, and replied to the
ones that really don't.

If you think one of the patches that I rejected really is needed, please
provide specific detail of what you try to do, how it doesn't work, and what
you think is the reason.

All applied patches have been pushed to my devel-3.2 branch.

Thanks,
NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

RE: [PATCH 1/7] FIX: Verify Backup file name before reshape

am 02.03.2011 08:39:11 von adam.kwolek

> -----Original Message-----
> From: NeilBrown [mailto:neilb@suse.de]
> Sent: Wednesday, March 02, 2011 2:02 AM
> To: Kwolek, Adam
> Cc: linux-raid@vger.kernel.org; Williams, Dan J; Ciechanowski, Ed;
> Neubauer, Wojciech
> Subject: Re: [PATCH 1/7] FIX: Verify Backup file name before reshape
>
> On Tue, 01 Mar 2011 15:56:50 +0100 Adam Kwolek
> wrote:
>
> > When reshape is continued backup_file is required for user data
> safety.
> > Grow_continue() has to verify if any file name is passed in.
> >
> > Signed-off-by: Adam Kwolek
> > ---
> >
> > Grow.c | 5 +++++
> > 1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/Grow.c b/Grow.c
> > index 47b8809..1470a91 100644
> > --- a/Grow.c
> > +++ b/Grow.c
> > @@ -3332,6 +3332,11 @@ int Grow_continue(int mdfd, struct supertype
> *st, struct mdinfo *info,
> > char *container = NULL;
> > int err;
> >
> > + if (backup_file == NULL) {
> > + fprintf(stderr, Name ": Backup file name has to be specified
> "
> > + "for reshape continuation.\n");
> > + return 1;
> > + }
> > if (!st->ss->external) {
> > err = sysfs_set_str(info, NULL, "array_state", "readonly");
> > if (err)
>
>
> reshape_array already performs checks to ensure that backup_file is set
> when
> needed - it isn't always needed.
>
> Is there some reason those checks are not enough?

If container operation will be introduced,
check in reshape_array() will be in forked part of code and Assembly will not know results.

BR
Adam

>
> NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

RE: [PATCH 3/7] FIX: configure disks slot for expansion

am 02.03.2011 08:48:53 von adam.kwolek

> -----Original Message-----
> From: linux-raid-owner@vger.kernel.org [mailto:linux-raid-
> owner@vger.kernel.org] On Behalf Of NeilBrown
> Sent: Wednesday, March 02, 2011 2:10 AM
> To: Kwolek, Adam
> Cc: linux-raid@vger.kernel.org; Williams, Dan J; Ciechanowski, Ed;
> Neubauer, Wojciech
> Subject: Re: [PATCH 3/7] FIX: configure disks slot for expansion
>
> On Tue, 01 Mar 2011 15:57:06 +0100 Adam Kwolek
> wrote:
>
> > Some raid_disks that are used for expansion, are not configured yet.
> > This is due to earlier set raid_disks limitation.
> > Set raid_disks to new (bigger) value and finish disks slot
> configuration.
> >
> > Signed-off-by: Adam Kwolek
> > ---
> >
> > Assemble.c | 15 ++++++++++++++-
> > 1 files changed, 14 insertions(+), 1 deletions(-)
> >
> > diff --git a/Assemble.c b/Assemble.c
> > index 6aff049..fa3a0a6 100644
> > --- a/Assemble.c
> > +++ b/Assemble.c
> > @@ -1586,9 +1586,22 @@ int assemble_container_content(struct supertype
> *st, int mdfd,
> > chosen_name, working + preexist);
> > if (preexist)
> > fprintf(stderr, " (%d new)", working);
> > - if (expansion)
> > + if (expansion) {
> > fprintf(stderr, " ( + %d for expansion)",
> > expansion);
> > + sysfs_set_num(content, NULL, "raid_disks",
> > + content->array.raid_disks + expansion);
> > + for (dev = content->devs; dev; dev = dev->next)
> > + if (dev->disk.raid_disk >=
> > + content->array.raid_disks) {
> > + int rv;
> > + dprintf("\n\tExpansion: configure slot:"
> > + "%i", dev->disk.raid_disk);
> > + rv = sysfs_set_num(content, dev, "slot",
> > + dev->disk.raid_disk);
> > + dprintf(" (status = %i)\n", rv);
> > + }
> > + }
> > fprintf(stderr, "\n");
> > }
> > if (!err)
>
>
> I thought I explained how this was suppose to work....
>
> 1/ Set the 'old' geometry of the array. sysfs_set_array does this.
> 2/ Set 'reshape_position'. sysfs_set_array does this.
> 3/ Set the 'new' geometry of the array. sysfs_set_array should do this
> but
> it doesn't.
> 4/ Add all the disks. Repeated calls to sysfs_add_disk will do this.
> 5/ start the array readonly . assemble_container_content calls
> sysfs_set_str
> to do this.
>
> That is all.
>
> NeilBrown

Yes, I remember that.
I want to run correctly process first and then, I'll switch to points you specified above.

So this is not misunderstanding but work in progress /midpoint/ only ;)

BR
Adam

>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

RE: [PATCH 0/7] Grow_continue, use in assembly (cont.)

am 02.03.2011 08:49:18 von adam.kwolek

> -----Original Message-----
> From: NeilBrown [mailto:neilb@suse.de]
> Sent: Wednesday, March 02, 2011 2:31 AM
> To: Kwolek, Adam
> Cc: linux-raid@vger.kernel.org; Williams, Dan J; Ciechanowski, Ed;
> Neubauer, Wojciech
> Subject: Re: [PATCH 0/7] Grow_continue, use in assembly (cont.)
>
> On Tue, 01 Mar 2011 15:56:41 +0100 Adam Kwolek
> wrote:
>
> > The following series implements next part of resuming reshape from
> checkpoint.
> > In this series call to invoke reshape is included.
> > It is required to have backup file to run reshape, so backup file
> validation is added
> > (without checking in file system)
> > Array seams to be configured for reshape, monitor is blocked and
> doesn't makes changes
> > to process. On the end of reshape monitor unblock is placed also.
> >
> > In patch:
> > Continue reshape after assembling array
> > some plans for supporting container operations is placed.
> >
> > Reshape restoring is not working yet (a few more pathes are still
> required)
> > I hope some of therm I'll post tomorrow.
> >
> > BR
> > Adam
> >
> > ---
> >
> > Adam Kwolek (7):
> > FIX: array is frozen after reshape
> > Continue reshape after assembling array
> > FIX: Block monitor when starting array with reshape in progress
> > Add block_subarray()
> > FIX: configure disks slot for expansion
> > FIX: reshape in md should wait for monitoring process (external
> metadata)
> > FIX: Verify Backup file name before reshape
> >
> >
> > Assemble.c | 64 +++++++++++++++++++++++++++++++++++++++++++++---
> ---------
> > Grow.c | 15 ++++++++++++-
> > Incremental.c | 1 +
> > msg.c | 18 ++++++++++++----
> > msg.h | 2 ++
> > 5 files changed, 81 insertions(+), 19 deletions(-)
> >
>
>
> I have applied the patches among these which make sense, and replied to
> the
> ones that really don't.
>
> If you think one of the patches that I rejected really is needed, please
> provide specific detail of what you try to do, how it doesn't work, and
> what
> you think is the reason.
>
> All applied patches have been pushed to my devel-3.2 branch.
>
> Thanks,
> NeilBrown

Thanks, I'll review your comments.

I think that patches:
FIX: Continue reshape in the background
FIX: array is frozen after reshape
and reworked:
FIX: Verify Backup file name before reshape
for fork() in Grow_continue() will be needed for container operation support.

BR
Adam

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html