diff -urb linux-2.6.1-mm1/drivers/md/raid6main.c raid6-linux/drivers/md/raid6main.c --- linux-2.6.1-mm1/drivers/md/raid6main.c 2004-01-09 18:10:05.000000000 -0800 +++ raid6-linux/drivers/md/raid6main.c 2004-01-09 18:22:54.000000000 -0800 @@ -5,7 +5,7 @@ * Copyright (C) 2002, 2003 H. Peter Anvin * * RAID-6 management functions. This code is derived from raid5.c. - * Last merge from raid5.c bkcvs version 1.78. + * Last merge from raid5.c bkcvs version 1.79 (kernel 2.6.1). * * Thanks to Penguin Computing for making the RAID-6 development possible * by donating a test server! @@ -1756,6 +1756,16 @@ print_raid6_conf(conf); + /* read-ahead size must cover a whole stripe, which is + * (n-2) * chunksize where 'n' is the number of raid devices + */ + { + int stripe = (mddev->raid_disks-2) * mddev->chunk_size + / PAGE_CACHE_SIZE; + if (mddev->queue->backing_dev_info.ra_pages < stripe) + mddev->queue->backing_dev_info.ra_pages = stripe; + } + /* Ok, everything is just fine now */ mddev->array_size = mddev->size * (mddev->raid_disks - 2); return 0;