* [PATCH 0/2] Do not allow for resync during reshape
@ 2011-09-29 15:45 Adam Kwolek
2011-09-29 15:45 ` [PATCH 1/2] imsm: FIX: Do not allow for spare disk activation " Adam Kwolek
2011-09-29 15:45 ` [PATCH 2/2] imsm: Do not mark resync " Adam Kwolek
0 siblings, 2 replies; 5+ messages in thread
From: Adam Kwolek @ 2011-09-29 15:45 UTC (permalink / raw)
To: neilb; +Cc: linux-raid, ed.ciechanowski, marcin.labun, dan.j.williams
The following series blocks for IMSM metadata starting resync process
when there is active reshape in the same container.
BR
Adam
---
Adam Kwolek (2):
imsm: Do not mark resync during reshape
imsm: FIX: Do not allow for spare disk activation during reshape
super-intel.c | 41 ++++++++++++++++++++++++++++++++++-------
1 files changed, 34 insertions(+), 7 deletions(-)
--
Signature
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] imsm: FIX: Do not allow for spare disk activation during reshape
2011-09-29 15:45 [PATCH 0/2] Do not allow for resync during reshape Adam Kwolek
@ 2011-09-29 15:45 ` Adam Kwolek
2011-10-02 23:31 ` NeilBrown
2011-09-29 15:45 ` [PATCH 2/2] imsm: Do not mark resync " Adam Kwolek
1 sibling, 1 reply; 5+ messages in thread
From: Adam Kwolek @ 2011-09-29 15:45 UTC (permalink / raw)
To: neilb; +Cc: linux-raid, ed.ciechanowski, marcin.labun, dan.j.williams
Spare disk activation or starting repair for one array while on second
reshape is in progress, will lead to IMSM incompatible situation when
2 arrays in container shares different disks sets.
This can cause that 2 processes in container /reshape and rebuild/
are in progress in parallel. This is IMSM incompatible situation also.
Block spare disk activation and starting resync if any reshape in container
is in progress.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---
super-intel.c | 33 +++++++++++++++++++++++++++++----
1 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index 07d47b5..5504c17 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -2237,6 +2237,33 @@ static int write_imsm_migr_rec(struct supertype *st)
}
#endif /* MDASSEMBLE */
+/* spare/missing disks activations are not allowe when
+ * array/container performs reshape operation, because
+ * all arrays in container works on the same disks set
+ */
+int imsm_reshape_blocks_arrays_changes(struct intel_super *super)
+{
+ int rv = 0;
+ struct intel_dev *i_dev = super->devlist;
+ struct imsm_dev *dev;
+
+ /* check whole container
+ */
+ while (i_dev) {
+ dev = i_dev->dev;
+ if (dev->vol.migr_state &&
+ dev->vol.migr_type == MIGR_GEN_MIGR) {
+ /* No repair during any migration in container
+ */
+ rv = 1;
+ break;
+ }
+ i_dev = i_dev->next;
+ }
+
+ return rv;
+}
+
static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, char *dmap)
{
struct intel_super *super = st->sb;
@@ -6592,10 +6619,8 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a,
dprintf("imsm: activate spare: inst=%d failed=%d (%d) level=%d\n",
inst, failed, a->info.array.raid_disks, a->info.array.level);
- if (dev->vol.migr_state &&
- dev->vol.migr_type == MIGR_GEN_MIGR)
- /* No repair during migration */
- return NULL;
+ if (imsm_reshape_blocks_arrays_changes(super))
+ return NULL;
if (a->info.array.level == 4)
/* No repair for takeovered array
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] imsm: Do not mark resync during reshape
2011-09-29 15:45 [PATCH 0/2] Do not allow for resync during reshape Adam Kwolek
2011-09-29 15:45 ` [PATCH 1/2] imsm: FIX: Do not allow for spare disk activation " Adam Kwolek
@ 2011-09-29 15:45 ` Adam Kwolek
2011-10-02 23:31 ` NeilBrown
1 sibling, 1 reply; 5+ messages in thread
From: Adam Kwolek @ 2011-09-29 15:45 UTC (permalink / raw)
To: neilb; +Cc: linux-raid, ed.ciechanowski, marcin.labun, dan.j.williams
During reshape, resync/rebuild in the same container is not possible
due to fact that all arrays in container has to share the same disks set.
Block new resync/rebuild process initialization and setting resync_start
to 0 while any reshape in container is active. This avoids breaking
container reshape and doesn't allow for starting multiple processes
/resync/rebuild and reshape/ at the same time in md.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---
super-intel.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index 5504c17..4c546ac 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -2375,8 +2375,9 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
info->reshape_progress = 0;
info->resync_start = MaxSector;
- if (map_to_analyse->map_state == IMSM_T_STATE_UNINITIALIZED ||
- dev->vol.dirty) {
+ if ((map_to_analyse->map_state == IMSM_T_STATE_UNINITIALIZED ||
+ dev->vol.dirty) &&
+ imsm_reshape_blocks_arrays_changes(super) == 0) {
info->resync_start = 0;
}
if (dev->vol.migr_state) {
@@ -6232,7 +6233,8 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
super->updates_pending++;
a->last_checkpoint = 0;
}
- } else if (!is_resyncing(dev) && !failed) {
+ } else if ((!is_resyncing(dev) && !failed) &&
+ (imsm_reshape_blocks_arrays_changes(super) == 0)) {
/* mark the start of the init process if nothing is failed */
dprintf("imsm: mark resync start\n");
if (map->map_state == IMSM_T_STATE_UNINITIALIZED)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] imsm: FIX: Do not allow for spare disk activation during reshape
2011-09-29 15:45 ` [PATCH 1/2] imsm: FIX: Do not allow for spare disk activation " Adam Kwolek
@ 2011-10-02 23:31 ` NeilBrown
0 siblings, 0 replies; 5+ messages in thread
From: NeilBrown @ 2011-10-02 23:31 UTC (permalink / raw)
To: Adam Kwolek; +Cc: linux-raid, ed.ciechanowski, marcin.labun, dan.j.williams
[-- Attachment #1: Type: text/plain, Size: 2439 bytes --]
On Thu, 29 Sep 2011 17:45:36 +0200 Adam Kwolek <adam.kwolek@intel.com> wrote:
> Spare disk activation or starting repair for one array while on second
> reshape is in progress, will lead to IMSM incompatible situation when
> 2 arrays in container shares different disks sets.
> This can cause that 2 processes in container /reshape and rebuild/
> are in progress in parallel. This is IMSM incompatible situation also.
>
> Block spare disk activation and starting resync if any reshape in container
> is in progress.
>
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Thanks - applied.
(though I changed the while loop into a for loop... I couldn't help myself ;-)
NeilBrown
> ---
>
> super-intel.c | 33 +++++++++++++++++++++++++++++----
> 1 files changed, 29 insertions(+), 4 deletions(-)
>
> diff --git a/super-intel.c b/super-intel.c
> index 07d47b5..5504c17 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -2237,6 +2237,33 @@ static int write_imsm_migr_rec(struct supertype *st)
> }
> #endif /* MDASSEMBLE */
>
> +/* spare/missing disks activations are not allowe when
> + * array/container performs reshape operation, because
> + * all arrays in container works on the same disks set
> + */
> +int imsm_reshape_blocks_arrays_changes(struct intel_super *super)
> +{
> + int rv = 0;
> + struct intel_dev *i_dev = super->devlist;
> + struct imsm_dev *dev;
> +
> + /* check whole container
> + */
> + while (i_dev) {
> + dev = i_dev->dev;
> + if (dev->vol.migr_state &&
> + dev->vol.migr_type == MIGR_GEN_MIGR) {
> + /* No repair during any migration in container
> + */
> + rv = 1;
> + break;
> + }
> + i_dev = i_dev->next;
> + }
> +
> + return rv;
> +}
> +
> static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, char *dmap)
> {
> struct intel_super *super = st->sb;
> @@ -6592,10 +6619,8 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a,
> dprintf("imsm: activate spare: inst=%d failed=%d (%d) level=%d\n",
> inst, failed, a->info.array.raid_disks, a->info.array.level);
>
> - if (dev->vol.migr_state &&
> - dev->vol.migr_type == MIGR_GEN_MIGR)
> - /* No repair during migration */
> - return NULL;
> + if (imsm_reshape_blocks_arrays_changes(super))
> + return NULL;
>
> if (a->info.array.level == 4)
> /* No repair for takeovered array
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] imsm: Do not mark resync during reshape
2011-09-29 15:45 ` [PATCH 2/2] imsm: Do not mark resync " Adam Kwolek
@ 2011-10-02 23:31 ` NeilBrown
0 siblings, 0 replies; 5+ messages in thread
From: NeilBrown @ 2011-10-02 23:31 UTC (permalink / raw)
To: Adam Kwolek; +Cc: linux-raid, ed.ciechanowski, marcin.labun, dan.j.williams
[-- Attachment #1: Type: text/plain, Size: 1828 bytes --]
On Thu, 29 Sep 2011 17:45:45 +0200 Adam Kwolek <adam.kwolek@intel.com> wrote:
> During reshape, resync/rebuild in the same container is not possible
> due to fact that all arrays in container has to share the same disks set.
>
> Block new resync/rebuild process initialization and setting resync_start
> to 0 while any reshape in container is active. This avoids breaking
> container reshape and doesn't allow for starting multiple processes
> /resync/rebuild and reshape/ at the same time in md.
>
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> ---
>
> super-intel.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/super-intel.c b/super-intel.c
> index 5504c17..4c546ac 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -2375,8 +2375,9 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
>
> info->reshape_progress = 0;
> info->resync_start = MaxSector;
> - if (map_to_analyse->map_state == IMSM_T_STATE_UNINITIALIZED ||
> - dev->vol.dirty) {
> + if ((map_to_analyse->map_state == IMSM_T_STATE_UNINITIALIZED ||
> + dev->vol.dirty) &&
> + imsm_reshape_blocks_arrays_changes(super) == 0) {
> info->resync_start = 0;
> }
> if (dev->vol.migr_state) {
> @@ -6232,7 +6233,8 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
> super->updates_pending++;
> a->last_checkpoint = 0;
> }
> - } else if (!is_resyncing(dev) && !failed) {
> + } else if ((!is_resyncing(dev) && !failed) &&
> + (imsm_reshape_blocks_arrays_changes(super) == 0)) {
> /* mark the start of the init process if nothing is failed */
> dprintf("imsm: mark resync start\n");
> if (map->map_state == IMSM_T_STATE_UNINITIALIZED)
Applied. Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-02 23:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-29 15:45 [PATCH 0/2] Do not allow for resync during reshape Adam Kwolek
2011-09-29 15:45 ` [PATCH 1/2] imsm: FIX: Do not allow for spare disk activation " Adam Kwolek
2011-10-02 23:31 ` NeilBrown
2011-09-29 15:45 ` [PATCH 2/2] imsm: Do not mark resync " Adam Kwolek
2011-10-02 23:31 ` NeilBrown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).