Whamcloud - gitweb
0334abdcab23f937eb5c164ed9c6262a3d269981
[fs/lustre-release.git] / lustre / kernel_patches / patches / raid5-mmp-unplug-dev.patch
1 Index: linux-2.6.22.14/drivers/md/raid5.c
2 ===================================================================
3 --- linux-2.6.22.14.orig/drivers/md/raid5.c
4 +++ linux-2.6.22.14/drivers/md/raid5.c
5 @@ -1268,6 +1268,8 @@ static int add_stripe_bio(struct stripe_
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 @@ -2972,6 +2974,8 @@ static int make_request(request_queue_t 
15                               test_bit(BIO_UPTODATE, &bi->bi_flags)
16                                 ? 0 : -EIO);
17         }
18 +       if (bio_sync(bi))
19 +               raid5_unplug_device(q);
20         return 0;
21  }
22