GIT: unionfs2-2.6.27.y: md/raid1: fix counting of write targets.

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:15:28 EDT 2010


commit faeb8ec4bf76f163317e9b885c5eb35ee960f705
Author: NeilBrown <neilb at suse.de>
Date:   Tue May 18 15:27:13 2010 +1000

    md/raid1: fix counting of write targets.
    
    commit 964147d5c86d63be79b442c30f3783d49860c078 upstream.
    
    There is a very small race window when writing to a
    RAID1 such that if a device is marked faulty at exactly the wrong
    time, the write-in-progress will not be sent to the device,
    but the bitmap (if present) will be updated to say that
    the write was sent.
    
    Then if the device turned out to still be usable as was re-added
    to the array, the bitmap-based-resync would skip resyncing that
    block, possibly leading to corruption.  This would only be a problem
    if no further writes were issued to that area of the device (i.e.
    that bitmap chunk).
    
    Suitable for any pending -stable kernel.
    
    Signed-off-by: NeilBrown <neilb at suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 2b510a3..acbbe5d 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -879,9 +879,10 @@ static int make_request(struct request_queue *q, struct bio * bio)
 			if (test_bit(Faulty, &rdev->flags)) {
 				rdev_dec_pending(rdev, mddev);
 				r1_bio->bios[i] = NULL;
-			} else
+			} else {
 				r1_bio->bios[i] = bio;
-			targets++;
+				targets++;
+			}
 		} else
 			r1_bio->bios[i] = NULL;
 	}


More information about the unionfs-cvs mailing list