* [PATCH] imsm: fix: add support for OLCE and migration to imsm_count_failed
@ 2011-11-04 13:52 Lukasz Dorau
2011-11-07 1:30 ` NeilBrown
0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Dorau @ 2011-11-04 13:52 UTC (permalink / raw)
To: neilb; +Cc: linux-raid, dan.j.williams, marcin.labun, ed.ciechanowski
The problem occurs when array under OLCE (from 3 to 6 disks)
is assembled incrementally. Mdadm tries to start array
just after adding the third disk (this is equal to the number of disks
before the start of reshape). It does not succeed,
the volume does not assembly correctly.
The function counting failed disks (imsm_count_failed())
was fixed for migration case. Now all disk members in both maps
are checked when failed disks are counted correctly.
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
---
super-intel.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index f776be9..215679d 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5943,6 +5943,7 @@ static int imsm_count_failed(struct intel_super *super, struct imsm_dev *dev)
struct imsm_disk *disk;
struct imsm_map *map = get_imsm_map(dev, 0);
struct imsm_map *prev = get_imsm_map(dev, dev->vol.migr_state);
+ struct imsm_map *map_for_loop;
__u32 ord;
int idx;
@@ -5951,13 +5952,18 @@ static int imsm_count_failed(struct intel_super *super, struct imsm_dev *dev)
* map[0]. So we look through all the disks we started with and
* see if any failures are still present, or if any new ones
* have arrived
- *
- * FIXME add support for online capacity expansion and
- * raid-level-migration
*/
- for (i = 0; i < prev->num_members; i++) {
- ord = __le32_to_cpu(prev->disk_ord_tbl[i]);
- ord |= __le32_to_cpu(map->disk_ord_tbl[i]);
+ map_for_loop = prev;
+ if (is_gen_migration(dev))
+ if (prev && (map->num_members > prev->num_members))
+ map_for_loop = map;
+
+ for (i = 0; i < map_for_loop->num_members; i++) {
+ ord = 0;
+ if (i < prev->num_members)
+ ord |= __le32_to_cpu(prev->disk_ord_tbl[i]);
+ if (i < map->num_members)
+ ord |= __le32_to_cpu(map->disk_ord_tbl[i]);
idx = ord_to_idx(ord);
disk = get_imsm_disk(super, idx);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] imsm: fix: add support for OLCE and migration to imsm_count_failed
2011-11-04 13:52 [PATCH] imsm: fix: add support for OLCE and migration to imsm_count_failed Lukasz Dorau
@ 2011-11-07 1:30 ` NeilBrown
0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2011-11-07 1:30 UTC (permalink / raw)
To: Lukasz Dorau; +Cc: linux-raid, dan.j.williams, marcin.labun, ed.ciechanowski
[-- Attachment #1: Type: text/plain, Size: 2191 bytes --]
On Fri, 04 Nov 2011 14:52:14 +0100 Lukasz Dorau <lukasz.dorau@intel.com>
wrote:
> The problem occurs when array under OLCE (from 3 to 6 disks)
> is assembled incrementally. Mdadm tries to start array
> just after adding the third disk (this is equal to the number of disks
> before the start of reshape). It does not succeed,
> the volume does not assembly correctly.
>
> The function counting failed disks (imsm_count_failed())
> was fixed for migration case. Now all disk members in both maps
> are checked when failed disks are counted correctly.
>
> Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
> ---
> super-intel.c | 18 ++++++++++++------
> 1 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/super-intel.c b/super-intel.c
> index f776be9..215679d 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -5943,6 +5943,7 @@ static int imsm_count_failed(struct intel_super *super, struct imsm_dev *dev)
> struct imsm_disk *disk;
> struct imsm_map *map = get_imsm_map(dev, 0);
> struct imsm_map *prev = get_imsm_map(dev, dev->vol.migr_state);
> + struct imsm_map *map_for_loop;
> __u32 ord;
> int idx;
>
> @@ -5951,13 +5952,18 @@ static int imsm_count_failed(struct intel_super *super, struct imsm_dev *dev)
> * map[0]. So we look through all the disks we started with and
> * see if any failures are still present, or if any new ones
> * have arrived
> - *
> - * FIXME add support for online capacity expansion and
> - * raid-level-migration
> */
> - for (i = 0; i < prev->num_members; i++) {
> - ord = __le32_to_cpu(prev->disk_ord_tbl[i]);
> - ord |= __le32_to_cpu(map->disk_ord_tbl[i]);
> + map_for_loop = prev;
> + if (is_gen_migration(dev))
> + if (prev && (map->num_members > prev->num_members))
> + map_for_loop = map;
> +
> + for (i = 0; i < map_for_loop->num_members; i++) {
> + ord = 0;
> + if (i < prev->num_members)
> + ord |= __le32_to_cpu(prev->disk_ord_tbl[i]);
> + if (i < map->num_members)
> + ord |= __le32_to_cpu(map->disk_ord_tbl[i]);
> idx = ord_to_idx(ord);
>
> disk = get_imsm_disk(super, idx);
applied - thanks.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-07 1:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-04 13:52 [PATCH] imsm: fix: add support for OLCE and migration to imsm_count_failed Lukasz Dorau
2011-11-07 1:30 ` 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).