[PATCH 0/2] Fixes for double degraded array

[PATCH 0/2] Fixes for double degraded array

am 23.03.2011 16:04:11 von krzysztof.wojcik

Two fixes for double degraded array;
1. Fix in mdmon
2. Fix for raid0->raid10 takeover tests

---

Krzysztof Wojcik (2):
FIX: imsm: Rebuild does not start on second failed disk
FIX: Tests: raid0->raid10 without degradation


monitor.c | 4 ++++
tests/18imsm-r0_2d-takeover-r10_4d | 4 +++-
tests/env-imsm-template | 7 -------
tests/imsm-grow-template | 7 ++-----
4 files changed, 9 insertions(+), 13 deletions(-)

--
Krzysztof Wojcik
--
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] FIX: imsm: Rebuild does not start on second failed disk

am 23.03.2011 16:04:20 von krzysztof.wojcik

Problem:
If we have an array with two failed disks and the array is in degraded
state (now it is possible only for raid10 with 2 degraded mirrors) and
we have two spare devices in the container, recovery process should be
triggered on booth failed disks. It does not.
Recovery is triggered only for first failed disk.
Second failed disk remains unchanged although the spare drive exists
in the container and is ready to recovery.

Root cause:
mdmon does not check if the array is degraded after recovery of first
drive is completed.

Resolution:
Check if current number of disks in the array equals target number of disks.
If not, trigger degradation check and then recovery process.

Signed-off-by: Krzysztof Wojcik
---
monitor.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/monitor.c b/monitor.c
index 4a34bc1..7ac5907 100644
--- a/monitor.c
+++ b/monitor.c
@@ -219,6 +219,7 @@ static int read_and_act(struct active_array *a)
int deactivate = 0;
struct mdinfo *mdi;
int dirty = 0;
+ int count = 0;

a->next_state = bad_word;
a->next_action = bad_action;
@@ -311,7 +312,10 @@ static int read_and_act(struct active_array *a)
mdi->curr_state);
if (! (mdi->curr_state & DS_INSYNC))
check_degraded = 1;
+ count++;
}
+ if (count != a->info.array.raid_disks)
+ check_degraded = 1;
}

if (!deactivate &&

--
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] FIX: Tests: raid0->raid10 without degradation

am 23.03.2011 16:04:28 von krzysztof.wojcik

raid0->raid10 transition needs at least 2 spare devices.
After level changing to raid10 recovery is triggered on
failed (missing) disks. At the end of recovery process
we have fully operational (not degraded) raid10 array.

Initialy there was possibility to migrate raid0->raid10
without recovery triggering (it results degraded raid10).
Now it is not possible.
This patch adapt tests to new mdadm's behavior.

Signed-off-by: Krzysztof Wojcik
---
tests/18imsm-r0_2d-takeover-r10_4d | 4 +++-
tests/env-imsm-template | 7 -------
tests/imsm-grow-template | 7 ++-----
3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/tests/18imsm-r0_2d-takeover-r10_4d b/tests/18imsm-r0_2d-takeover-r10_4d
index a1c395b..51ad3fc 100644
--- a/tests/18imsm-r0_2d-takeover-r10_4d
+++ b/tests/18imsm-r0_2d-takeover-r10_4d
@@ -5,6 +5,7 @@

num_disks=2
device_list="$dev0 $dev1"
+spare_list="$dev2 $dev3"

# Before: RAID 0 volume, 2 disks, 256k chunk size
vol0_level=0
@@ -18,4 +19,5 @@ vol0_new_level=10
vol0_new_num_comps=$vol0_num_comps
vol0_new_chunk=128

-. tests/imsm-grow-template 0 1 1
+. tests/imsm-grow-template 0 1
+
diff --git a/tests/env-imsm-template b/tests/env-imsm-template
index 7a2890c..30b73db 100644
--- a/tests/env-imsm-template
+++ b/tests/env-imsm-template
@@ -13,7 +13,6 @@ imsm_check() {
t_size=$6
t_offset=$7
t_chunk=$8
- t_takeover10=$9

err=0

@@ -27,13 +26,7 @@ imsm_check() {
echo "**Error**: Chunk size mismatch - expected $t_chunk, actual $_chunk" >&2
err=$((err + 1))
fi
- if [ ! -z $t_takeover10 ] ; then
- t_num_disks=$(( t_num_disks * 2 ))
- fi
for i in `seq 0 $((t_num_disks - 1))`; do
- if [ ! -z $t_takeover10 ] && [ ! -z $(( $i % 2 )) ] ; then
- continue
- fi
_offset=`cat ${sysfs}/md/rd${i}/offset`
if [ $t_offset -ne $((_offset / 2)) ]; then
echo "**Error**: Offset mismatch - expected $t_offset, actual $_offset" >&2
diff --git a/tests/imsm-grow-template b/tests/imsm-grow-template
index d03752d..191f056 100644
--- a/tests/imsm-grow-template
+++ b/tests/imsm-grow-template
@@ -5,9 +5,6 @@ negative_test=$1
# 0 - On-line Capacity Expansion test, otherwise LEVEL migration or CHUNK size migration test
migration_test=$2

-# 1 - raid0 -> raid10 takeover verification
-takeover10_test=$3
-
function grow_member() {
local member=$1
local disks=$2
@@ -31,8 +28,8 @@ function grow_member() {
fi
check wait
sleep 5
- imsm_check member $member $disks $level $size $array_size $offset $chunk $takeover10_test
- testdev $member $comps $size $chunk $takeover10_test
+ imsm_check member $member $disks $level $size $array_size $offset $chunk
+ testdev $member $comps $size $chunk
}

# Create container

--
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 0/2] Fixes for double degraded array

am 24.03.2011 00:16:33 von NeilBrown

On Wed, 23 Mar 2011 16:04:11 +0100 Krzysztof Wojcik
wrote:

> Two fixes for double degraded array;
> 1. Fix in mdmon
> 2. Fix for raid0->raid10 takeover tests
>
> ---
>
> Krzysztof Wojcik (2):
> FIX: imsm: Rebuild does not start on second failed disk
> FIX: Tests: raid0->raid10 without degradation
>
>
> monitor.c | 4 ++++
> tests/18imsm-r0_2d-takeover-r10_4d | 4 +++-
> tests/env-imsm-template | 7 -------
> tests/imsm-grow-template | 7 ++-----
> 4 files changed, 9 insertions(+), 13 deletions(-)
>

Applied, thanks.

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