Whamcloud - gitweb
b=20595
[fs/lustre-release.git] / lustre / kernel_patches / patches / raid5-mmp-unplug-dev.patch
1 Index: linux-2.6.18-128.1.6/drivers/md/raid5.c
2 ===================================================================
3 --- linux-2.6.18-128.1.6.orig/drivers/md/raid5.c        2009-06-02 23:24:55.000000000 -0600
4 +++ linux-2.6.18-128.1.6/drivers/md/raid5.c     2009-06-02 23:27:21.000000000 -0600
5 @@ -1456,6 +1456,8 @@
6                 bi->bi_next = *bip;
7         *bip = bi;
8         bi->bi_phys_segments ++;
9 +       if (bio_sync(bi) && !forwrite)
10 +               clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); /* force to read from disk. */
11         spin_unlock_irq(&conf->device_lock);
12         spin_unlock(&sh->lock);
13  
14 @@ -3012,6 +3014,8 @@
15                 bi->bi_size = 0;
16                 bi->bi_end_io(bi, bytes, 0);
17         }
18 +       if (bio_sync(bi))
19 +               raid5_unplug_device(q);
20         return 0;
21  }
22