[PATCH] md: make sure raid5/raid6 resync uses correct 'max_sectors'

The default resync_max_sector is set to "mddev->size << 1". If the
raid-personality-module updates mddev->size, it must update
resync_max_sectors too.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by NeilBrown and committed by Linus Torvalds b1581566 57ee67af

+2
+1
drivers/md/raid5.c
··· 1653 1653 1654 1654 /* device size must be a multiple of chunk size */ 1655 1655 mddev->size &= ~(mddev->chunk_size/1024 -1); 1656 + mddev->resync_max_sectors = mddev->size << 1; 1656 1657 1657 1658 if (!conf->chunk_size || conf->chunk_size % 4) { 1658 1659 printk(KERN_ERR "raid5: invalid chunk size %d for %s\n",
+1
drivers/md/raid6main.c
··· 1813 1813 1814 1814 /* device size must be a multiple of chunk size */ 1815 1815 mddev->size &= ~(mddev->chunk_size/1024 -1); 1816 + mddev->resync_max_sectors = mddev->size << 1; 1816 1817 1817 1818 if (conf->raid_disks < 4) { 1818 1819 printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n",