Whamcloud - gitweb
LU-2442 kernel: SLES11 performance fixes and updates
[fs/lustre-release.git] / lustre / kernel_patches / patches / raid5-mmp-unplug-dev-sles11sp1.patch
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.
5
6 Index: linux-2.6.32/drivers/md/raid5.c
7 ===================================================================
8 --- linux-2.6.32.orig/drivers/md/raid5.c        2012-06-22 06:09:49.000000000 -0400
9 +++ linux-2.6.32/drivers/md/raid5.c     2013-01-25 10:11:10.076431000 -0500
10 @@ -2169,6 +2169,9 @@ static int add_stripe_bio(struct stripe_
11                 bi->bi_next = *bip;
12         *bip = bi;
13         bi->bi_phys_segments++;
14 +       /* force to read from disk. */
15 +       if ((bi->bi_rw & REQ_RW_SYNC) && !forwrite)
16 +               clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags);
17         spin_unlock_irq(&conf->device_lock);
18         spin_unlock(&sh->lock);
19  
20 @@ -4008,6 +4008,10 @@ static int make_request(mddev_t *mddev,
21  
22                 bio_endio(bi, 0);
23         }
24 +
25 +       if (bi->bi_rw & REQ_RW_SYNC)
26 +               md_wakeup_thread(mddev->thread);
27 +
28         return 0;
29  }
30