]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/md/raid5.c
md/raid5: Fix livelock when array is both resyncing and degraded.
[mirror_ubuntu-hirsute-kernel.git] / drivers / md / raid5.c
index aa76865b804b41c2b2af3b78f5b16c83eb034feb..e75d48c0421a41788c9159ef7e74d22ad93d9695 100644 (file)
@@ -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
                 */