[PATCH 1/2] FIX: During reshape array is in active state

[PATCH 1/2] FIX: During reshape array is in active state

am 08.03.2011 08:37:39 von adam.kwolek

During reshape array is in active state. This has to be considered during
calling set_array_state() and setting consistent flag.
Consistent flag during reshape has to be set to 1 to keep volume in clean state.

Signed-off-by: Adam Kwolek
---

monitor.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/monitor.c b/monitor.c
index fb2288d..0d238cf 100644
--- a/monitor.c
+++ b/monitor.c
@@ -384,7 +384,7 @@ static int read_and_act(struct active_array *a)
strncmp(buf, "none", 4) == 0)
a->last_checkpoint = a->info.component_size;
}
- a->container->ss->set_array_state(a, a->curr_state <= clean);
+ a->container->ss->set_array_state(a, a->curr_state <= active);
a->last_checkpoint = sync_completed;
}


--
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: FIX: Mark checkpoint and array state clean during

am 08.03.2011 08:37:47 von adam.kwolek

Array state has to be managed during reshape based on consistent flag.
To achieve this existing code will be reused. Currently existing code for
blocks_per_unit calculation can be removed
and existing code can be reused also.

Signed-off-by: Adam Kwolek
---

super-intel.c | 15 ++-------------
1 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index c5e459f..c0bff98 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5210,19 +5210,7 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
*/
if (a->curr_action == reshape) {
/* still reshaping, maybe update curr_migr_unit */
- long long blocks_per_unit = blocks_per_migr_unit(dev);
- long long unit = a->last_checkpoint;
- if (blocks_per_unit) {
- unit /= blocks_per_unit;
- if (unit >
- __le32_to_cpu(dev->vol.curr_migr_unit)) {
- dev->vol.curr_migr_unit =
- __cpu_to_le32(unit);
- dev->vol.dirty = 0;
- super->updates_pending++;
- }
- }
- return 0;
+ goto mark_checkpoint;
} else {
if (a->last_checkpoint == 0 && a->prev_action == reshape) {
/* for some reason we aborted the reshape.
@@ -5299,6 +5287,7 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
super->updates_pending++;
}

+mark_checkpoint:
/* check if we can update curr_migr_unit from resync_start, recovery_start */
blocks_per_unit = blocks_per_migr_unit(dev);
if (blocks_per_unit) {

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