[PATCH 0/2] Do not allow for resync during reshape

[PATCH 0/2] Do not allow for resync during reshape

am 29.09.2011 17:45:26 von adam.kwolek

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
--
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/2] imsm: FIX: Do not allow for spare disk activation during

am 29.09.2011 17:45:36 von adam.kwolek

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
---

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

--
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/2] imsm: Do not mark resync during reshape

am 29.09.2011 17:45:45 von adam.kwolek

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
---

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)

--
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/2] imsm: FIX: Do not allow for spare disk activationduring reshape

am 03.10.2011 01:31:16 von NeilBrown

--Sig_/K+X+3PlG4VYCrc6uBfFkbGX
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Thu, 29 Sep 2011 17:45:36 +0200 Adam Kwolek wrot=
e:

> 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.
>=20
> Block spare disk activation and starting resync if any reshape in contain=
er
> is in progress.
>=20
> Signed-off-by: Adam Kwolek

Thanks - applied.

(though I changed the while loop into a for loop... I couldn't help myself =
;-)

NeilBrown


> ---
>=20
> super-intel.c | 33 +++++++++++++++++++++++++++++----
> 1 files changed, 29 insertions(+), 4 deletions(-)
>=20
> 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 *s=
t)
> }
> #endif /* MDASSEMBLE */
> =20
> +/* 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 =3D 0;
> + struct intel_dev *i_dev =3D super->devlist;
> + struct imsm_dev *dev;
> +
> + /* check whole container
> + */
> + while (i_dev) {
> + dev =3D i_dev->dev;
> + if (dev->vol.migr_state &&
> + dev->vol.migr_type == MIGR_GEN_MIGR) {
> + /* No repair during any migration in container
> + */
> + rv =3D 1;
> + break;
> + }
> + i_dev =3D i_dev->next;
> + }
> +
> + return rv;
> +}
> +
> static void getinfo_super_imsm_volume(struct supertype *st, struct mdinf=
o *info, char *dmap)
> {
> struct intel_super *super =3D st->sb;
> @@ -6592,10 +6619,8 @@ static struct mdinfo *imsm_activate_spare(struct a=
ctive_array *a,
> dprintf("imsm: activate spare: inst=3D%d failed=3D%d (%d) level=3D%d\n",
> inst, failed, a->info.array.raid_disks, a->info.array.level);
> =20
> - 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;
> =20
> if (a->info.array.level == 4)
> /* No repair for takeovered array


--Sig_/K+X+3PlG4VYCrc6uBfFkbGX
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iD8DBQFOiPREG5fc6gV+Wb0RAoHeAKCpW9ikfMAwHAzx6d+z+gdpo4dPgwCg qvTB
RWkpHUyVJUq18pCcaXt+t+Y=
=ZonX
-----END PGP SIGNATURE-----

--Sig_/K+X+3PlG4VYCrc6uBfFkbGX--
--
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/2] imsm: Do not mark resync during reshape

am 03.10.2011 01:31:57 von NeilBrown

--Sig_/e1TConmB+cTWKChoyhvbj0A
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Thu, 29 Sep 2011 17:45:45 +0200 Adam Kwolek wrot=
e:

> 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.
>=20
> 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.
>=20
> Signed-off-by: Adam Kwolek
> ---
>=20
> super-intel.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>=20
> 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 supert=
ype *st, struct mdinfo *info,
> =20
> info->reshape_progress =3D 0;
> info->resync_start =3D 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 =3D 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 =3D 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


--Sig_/e1TConmB+cTWKChoyhvbj0A
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iD8DBQFOiPRtG5fc6gV+Wb0RAtU8AKCCCh7iktyN7JI5oSGAir1iJ3ku8QCf dUAd
R7Xx7Q1KaYCHRGLDCPXktlA=
=FHph
-----END PGP SIGNATURE-----

--Sig_/e1TConmB+cTWKChoyhvbj0A--
--
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