struct r5dev *fdev[2] = { &sh->dev[s->failed_num[0]],
                                  &sh->dev[s->failed_num[1]] };
        int i;
+       bool force_rcw = (sh->raid_conf->rmw_level == PARITY_DISABLE_RMW);
 
 
        if (test_bit(R5_LOCKED, &dev->flags) ||
                         * devices must be read.
                         */
                        return 1;
+
+               if (s->failed >= 2 &&
+                   (fdev[i]->towrite ||
+                    s->failed_num[i] == sh->pd_idx ||
+                    s->failed_num[i] == sh->qd_idx) &&
+                   !test_bit(R5_UPTODATE, &fdev[i]->flags))
+                       /* In max degraded raid6, If the failed disk is P, Q,
+                        * or we want to read the failed disk, we need to do
+                        * reconstruct-write.
+                        */
+                       force_rcw = true;
        }
 
-       /* If we are forced to do a reconstruct-write, either because
-        * the current RAID6 implementation only supports that, or
-        * because parity cannot be trusted and we are currently
-        * recovering it, there is extra need to be careful.
+       /* If we are forced to do a reconstruct-write, because parity
+        * cannot be trusted and we are currently recovering it, there
+        * is extra need to be careful.
         * If one of the devices that we would need to read, because
         * it is not being overwritten (and maybe not written at all)
         * is missing/faulty, then we need to read everything we can.
         */
-       if (sh->raid_conf->level != 6 &&
-           sh->raid_conf->rmw_level != PARITY_DISABLE_RMW &&
+       if (!force_rcw &&
            sh->sector < sh->raid_conf->mddev->recovery_cp)
                /* reconstruct-write isn't being forced */
                return 0;