Whamcloud - gitweb
LU-354 test: Change dev_set_rdonly() check to warning
[fs/lustre-release.git] / lustre / kernel_patches / patches / raid5-mmp-unplug-dev-rhel6.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-131.0.15.el6.x86_64/drivers/md/raid5.c
7 ===================================================================
8 --- linux-2.6.32-131.0.15.el6.x86_64.orig/drivers/md/raid5.c    2011-05-10 21:38:35.000000000 +0300
9 +++ linux-2.6.32-131.0.15.el6.x86_64/drivers/md/raid5.c 2011-05-20 08:26:04.000000000 +0300
10 @@ -2177,6 +2177,8 @@ static int add_stripe_bio(struct stripe_
11                 bi->bi_next = *bip;
12         *bip = bi;
13         bi->bi_phys_segments++;
14 +       if (bio_rw_flagged(bi, BIO_RW_SYNCIO) && !forwrite)
15 +               clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); /* force to read from disk. */
16         spin_unlock_irq(&conf->device_lock);
17         spin_unlock(&sh->lock);
18  
19 @@ -4132,6 +4134,9 @@ static int make_request(mddev_t *mddev, 
20                 bio_endio(bi, 0);
21         }
22  
23 +       if (bio_rw_flagged(bi, BIO_RW_SYNCIO))
24 +               md_raid5_unplug_device(conf);
25 +
26         return 0;
27  }
28