mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
md/raid5: Fix livelock when array is both resyncing and degraded.
Commita7854487cd: md: When RAID5 is dirty, force reconstruct-write instead of read-modify-write. Causes an RCW cycle to be forced even when the array is degraded. A degraded array cannot support RCW as that requires reading all data blocks, and one may be missing. Forcing an RCW when it is not possible causes a live-lock and the code spins, repeatedly deciding to do something that cannot succeed. So change the condition to only force RCW on non-degraded arrays. Reported-by: Manibalan P <[email protected]> Bisected-by: Jes Sorensen <[email protected]> Tested-by: Jes Sorensen <[email protected]> Signed-off-by: NeilBrown <[email protected]> Fixes:a7854487cdCc: [email protected] (v3.7+)
This commit is contained in:
parent
f04ebb0be7
commit
26ac107378
1 changed files with 2 additions and 1 deletions
|
|
@ -3170,7 +3170,8 @@ static void handle_stripe_dirtying(struct r5conf *conf,
|
|||
* generate correct data from the parity.
|
||||
*/
|
||||
if (conf->max_degraded == 2 ||
|
||||
(recovery_cp < MaxSector && sh->sector >= recovery_cp)) {
|
||||
(recovery_cp < MaxSector && sh->sector >= recovery_cp &&
|
||||
s->failed == 0)) {
|
||||
/* Calculate the real rcw later - for now make it
|
||||
* look like rcw is cheaper
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue