Commit 79d96b27 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

md/raid5: abort any pending parity operations when array fails.

commit 9a3f530f upstream.

When the number of failed devices exceeds the allowed number
we must abort any active parity operations (checks or updates) as they
are no longer meaningful, and can lead to a BUG_ON in
handle_parity_checks6.

This bug was introduce by commit 6c0069c0
in 2.6.29.
Reported-by: default avatarManish Katiyar <mkatiyar@gmail.com>
Tested-by: default avatarManish Katiyar <mkatiyar@gmail.com>
Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 91ed232d
......@@ -3120,12 +3120,16 @@ static void handle_stripe5(struct stripe_head *sh)
/* check if the array has lost two devices and, if so, some requests might
* need to be failed
*/
if (s.failed > 1 && s.to_read+s.to_write+s.written)
handle_failed_stripe(conf, sh, &s, disks, &return_bi);
if (s.failed > 1 && s.syncing) {
md_done_sync(conf->mddev, STRIPE_SECTORS,0);
clear_bit(STRIPE_SYNCING, &sh->state);
s.syncing = 0;
if (s.failed > 1) {
sh->check_state = 0;
sh->reconstruct_state = 0;
if (s.to_read+s.to_write+s.written)
handle_failed_stripe(conf, sh, &s, disks, &return_bi);
if (s.syncing) {
md_done_sync(conf->mddev, STRIPE_SECTORS,0);
clear_bit(STRIPE_SYNCING, &sh->state);
s.syncing = 0;
}
}
/* might be able to return some write requests if the parity block
......@@ -3412,12 +3416,16 @@ static void handle_stripe6(struct stripe_head *sh)
/* check if the array has lost >2 devices and, if so, some requests
* might need to be failed
*/
if (s.failed > 2 && s.to_read+s.to_write+s.written)
handle_failed_stripe(conf, sh, &s, disks, &return_bi);
if (s.failed > 2 && s.syncing) {
md_done_sync(conf->mddev, STRIPE_SECTORS,0);
clear_bit(STRIPE_SYNCING, &sh->state);
s.syncing = 0;
if (s.failed > 2) {
sh->check_state = 0;
sh->reconstruct_state = 0;
if (s.to_read+s.to_write+s.written)
handle_failed_stripe(conf, sh, &s, disks, &return_bi);
if (s.syncing) {
md_done_sync(conf->mddev, STRIPE_SECTORS,0);
clear_bit(STRIPE_SYNCING, &sh->state);
s.syncing = 0;
}
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment