isdn: fix random hard freeze with AVM cards using b1dma
[cascardo/linux.git] / drivers / md / raid1.c
index 0bcefad..16775a0 100644 (file)
@@ -1214,7 +1214,8 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
                                        j = 0;
                                if (j >= 0)
                                        mddev->resync_mismatches += r1_bio->sectors;
-                               if (j < 0 || test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) {
+                               if (j < 0 || (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)
+                                             && test_bit(BIO_UPTODATE, &sbio->bi_flags))) {
                                        sbio->bi_end_io = NULL;
                                        rdev_dec_pending(conf->mirrors[i].rdev, mddev);
                                } else {