1 Force MD devices to pass SYNC reads directly to the disk
2 instead of handling from cache. This is needed for MMP
3 on MD RAID devices, and in theory could be accepted in
4 the upstream kernel. Not needed for DMU.
6 Index: linux-3.0.35/drivers/md/raid5.c
7 ===================================================================
8 --- linux-3.0.35.orig/drivers/md/raid5.c 2012-06-22 06:09:49.000000000 -0400
9 +++ linux-3.0.35/drivers/md/raid5.c 2013-01-25 10:11:10.076431000 -0500
10 @@ -2169,6 +2169,9 @@ static int add_stripe_bio(struct stripe_
13 bi->bi_phys_segments++;
14 + /* force to read from disk. */
15 + if ((bi->bi_rw & REQ_SYNC) && !forwrite)
16 + clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags);
17 spin_unlock_irq(&conf->device_lock);
18 spin_unlock(&sh->lock);
20 @@ -4097,6 +4100,9 @@ static int make_request(mddev_t *mddev,
24 + if (bi->bi_rw & REQ_SYNC)
25 + md_wakeup_thread(mddev->thread);