Whamcloud - gitweb
74bd52957075fc1302150a88b6d4b88ef0d4615b
[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-71.18.1.el6-master/drivers/md/raid5.c
7 ===================================================================
8 --- linux-2.6.32-71.18.1.el6-master.orig/drivers/md/raid5.c     2011-02-28 16:57:31.222666050 +0800
9 +++ linux-2.6.32-71.18.1.el6-master/drivers/md/raid5.c  2011-02-28 16:58:27.011983275 +0800
10 @@ -2098,6 +2098,8 @@
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 @@ -4031,6 +4033,8 @@
20                 wait_event(mddev->thread->wqueue,
21                            atomic_read(&conf->preread_active_stripes) == 0);
22         }
23 +       if (bio_rw_flagged(bi, BIO_RW_SYNCIO))
24 +               raid5_unplug_device(mddev->queue);
25         return 0;
26  }
27