Bug in md grow code
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · On Thursday March 23, [email protected] wrote:
The code that checks all the devices in an array and tries to fit a grow request to the largest possible value is broken and will only do this successfully if the first element of the array isn't <= all other elements in the array. Not re-initializing the fit variable with each loop of the check solves the problems.
Ahh...yes, thanks.
Not quite critical enough to get into 2.6.16.1 I suspect, but I'll make sure it heads upstream for 2.6.17.
Thanks again,
NeilBrown
Quoted 27 lines
Signed-off-by Doug Ledford <[email protected]>Signature · 4 lines
Doug Ledford <[email protected]> 919-754-3700 x44233 Red Hat, Inc. 1801 Varsity Dr. Raleigh, NC 27606drivers/md/md.c renamed from drivers/md/md.c.save +1
-1@@ -2426,6 +2426,7 @@if (mddev->size != info->size) {mdk_rdev_t * rdev;struct list_head *tmp; +int fit = (info->size ==0 );if (mddev->pers->resize ==NULL )return -EINVAL ;/* The "size" is the amount of each device that is used. @@ -2442,7 +2443,6 @@return -EBUSY ; ITERATE_RDEV(mddev,rdev,tmp) {sector_t avail; -int fit = (info->size ==0 );if (rdev->sb_offset > rdev->data_offset) avail = (rdev->sb_offset*2 ) - rdev->data_offset;else