[PATCH] imsm: fix: correct adding and activation of spare disks

[PATCH] imsm: fix: correct adding and activation of spare disks

am 04.10.2011 16:56:54 von Lukasz Dorau

During activation of spare disks, only one of all available
spare disks can be activated at this moment.
It causes that for example during take-over from
RAID0 with 2 disks to RAID10, only one of two spare disks
is taken for recovery and a degraded RAID10 array
with only 3 of 4 working disks is created.
It has been fixed by adding more than one of all available
spare disks and saving them in additional_test_list
which is passed to imsm_add_spare().

Signed-off-by: Lukasz Dorau
---
super-intel.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 7de207a..3185e91 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -6672,9 +6672,9 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a,
*/
dl = imsm_readd(super, i, a);
if (!dl)
- dl = imsm_add_spare(super, i, a, 0, NULL);
+ dl = imsm_add_spare(super, i, a, 0, rv);
if (!dl)
- dl = imsm_add_spare(super, i, a, 1, NULL);
+ dl = imsm_add_spare(super, i, a, 1, rv);
if (!dl)
continue;

@@ -6711,8 +6711,6 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a,
num_spares++;
dprintf("%x:%x to be %d at %llu\n", dl->major, dl->minor,
i, di->data_offset);
-
- break;
}

if (!rv)

--
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] imsm: fix: correct adding and activation of spare disks

am 05.10.2011 05:19:14 von NeilBrown

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

On Tue, 04 Oct 2011 16:56:54 +0200 Lukasz Dorau
wrote:

> During activation of spare disks, only one of all available
> spare disks can be activated at this moment.
> It causes that for example during take-over from
> RAID0 with 2 disks to RAID10, only one of two spare disks
> is taken for recovery and a degraded RAID10 array
> with only 3 of 4 working disks is created.
> It has been fixed by adding more than one of all available
> spare disks and saving them in additional_test_list
> which is passed to imsm_add_spare().
>=20
> Signed-off-by: Lukasz Dorau
> ---
> super-intel.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>=20
> diff --git a/super-intel.c b/super-intel.c
> index 7de207a..3185e91 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -6672,9 +6672,9 @@ static struct mdinfo *imsm_activate_spare(struct ac=
tive_array *a,
> */
> dl =3D imsm_readd(super, i, a);
> if (!dl)
> - dl =3D imsm_add_spare(super, i, a, 0, NULL);
> + dl =3D imsm_add_spare(super, i, a, 0, rv);
> if (!dl)
> - dl =3D imsm_add_spare(super, i, a, 1, NULL);
> + dl =3D imsm_add_spare(super, i, a, 1, rv);
> if (!dl)
> continue;
> =20
> @@ -6711,8 +6711,6 @@ static struct mdinfo *imsm_activate_spare(struct ac=
tive_array *a,
> num_spares++;
> dprintf("%x:%x to be %d at %llu\n", dl->major, dl->minor,
> i, di->data_offset);
> -
> - break;
> }
> =20
> if (!rv)


applied, thanks,

NeilBrown

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

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

iD8DBQFOi8yyG5fc6gV+Wb0RAs4lAJ9HQNa2ghJj1DYAEL8ozAroDJEqzQCe I4eU
tAKGf88HtHV7Y955IpfJZ3c=
=SL/x
-----END PGP SIGNATURE-----

--Sig_/OoJyYum5r1WuLwcwc9dTZeV--
--
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