Make sure raid5/raid6 resync uses correct 'max_sectors'
PATCH 1/1 Make sure raid5/raid6 resync uses correct 'max_sectors'
In reply to a message not in the archiveI'm putting together a test-suite for mdadm and md (About time), and it found this bug for me. Without it, an array creating in just the right way (i.e. the way that mdadm-v2 creates array) will resync forever.
It would be good if this went into 2.6.13
Thanks,
NeilBrown
--
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 <[email protected]>
### Diffstat output
./drivers/md/raid5.c | 1 + ./drivers/md/raid6main.c | 1 + 2 files changed, 2 insertions(+)
drivers/md/raid5.c renamed from drivers/md/raid5.c~current~ +1 -0
@@ -1653,6 +1653,7 @@ static int run (mddev_t *mddev)/* device size must be a multiple of chunk size */ mddev->size &= ~(mddev->chunk_size/1024 -1 ); + mddev->resync_max_sectors = mddev->size <<1 ;if (!conf->chunk_size || conf->chunk_size %4 ) { printk(KERN_ERR "raid5: invalid chunk size %d for %s\n",
drivers/md/raid6main.c renamed from drivers/md/raid6main.c~current~ +1 -0
@@ -1813,6 +1813,7 @@ static int run (mddev_t *mddev)/* device size must be a multiple of chunk size */ mddev->size &= ~(mddev->chunk_size/1024 -1 ); + mddev->resync_max_sectors = mddev->size <<1 ;if (conf->raid_disks <4 ) { printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n",