Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a3f530f authored by NeilBrown's avatar NeilBrown
Browse files

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



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>
Cc: stable@kernel.org
parent 1ea6b8f4
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -3159,10 +3159,14 @@ static void handle_stripe(struct stripe_head *sh)
	/* check if the array has lost more than max_degraded devices and,
	 * if so, some requests might need to be failed.
	 */
	if (s.failed > conf->max_degraded && s.to_read+s.to_write+s.written)
	if (s.failed > conf->max_degraded) {
		sh->check_state = 0;
		sh->reconstruct_state = 0;
		if (s.to_read+s.to_write+s.written)
			handle_failed_stripe(conf, sh, &s, disks, &s.return_bi);
	if (s.failed > conf->max_degraded && s.syncing)
		if (s.syncing)
			handle_failed_sync(conf, sh, &s);
	}

	/*
	 * might be able to return some write requests if the parity blocks