Whamcloud - gitweb
LU-354 test: Change dev_set_rdonly() check to warning
[fs/lustre-release.git] / lustre / kernel_patches / patches / raid5-maxsectors-rhel5.patch
1 diff -ru linux-orig/drivers/md/raid5.c linux-new/drivers/md/raid5.c
2 --- linux-orig/drivers/md/raid5.c       2009-04-14 08:11:38.000000000 +1000
3 +++ linux-new/drivers/md/raid5.c        2009-09-20 05:02:02.000000000 +1000
4 @@ -3595,10 +3595,16 @@
5         mddev->array_size =  mddev->size * (conf->previous_raid_disks -
6                                             conf->max_degraded);
7  
8 +       int stripe_size = conf->chunk_size * (conf->previous_raid_disks - conf->max_degraded);
9 +
10         /* in order to support large I/Os */
11 -       blk_queue_max_sectors(mddev->queue, conf->chunk_size * conf->previous_raid_disks >> 9);
12 -       mddev->queue->max_phys_segments = conf->chunk_size * (conf->previous_raid_disks - conf->max_degraded) >> PAGE_SHIFT;
13 -       mddev->queue->max_hw_segments = conf->chunk_size * conf->previous_raid_disks >> PAGE_SHIFT;;
14 +       blk_queue_max_sectors(mddev->queue, stripe_size >> 9);
15 +       /* KTVM: set default max_sectors the same as the max_hw_sectors set above */
16 +       mddev->queue->max_sectors = mddev->queue->max_hw_sectors;
17 +       printk("%s: setting max_sectors = %d, max_hw_sectors = %d\n", mdname(mddev), mddev->queue->max_sectors, mddev->queue->max_hw_sectors);
18 +
19 +       mddev->queue->max_phys_segments = stripe_size >> PAGE_SHIFT;
20 +       mddev->queue->max_hw_segments = stripe_size >> PAGE_SHIFT;;
21  
22         /* raid5 device is able to do zcopy right now. */
23         mddev->queue->backing_dev_info.capabilities |= BDI_CAP_PAGE_CONSTANT_WRITE;