Grow: handle E2BIG from new_offset changes more gracefully.

If new_offset change is too big, just do the reshape the old way.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-05-21 16:35:29 +10:00
parent 4abcbc21b9
commit 9ad2a640fe
1 changed files with 5 additions and 2 deletions

7
Grow.c
View File

@ -2288,8 +2288,11 @@ static int set_new_data_offset(struct mdinfo *sra, struct supertype *st,
if (sysfs_set_num(sra, sd, "new_offset",
info2.new_data_offset) < 0) {
err = errno;
if (sd == sra->devs && err == ENOENT)
/* Early kernel, no 'new_offset' file.
err = -1;
if (sd == sra->devs &&
(errno == ENOENT || errno == E2BIG))
/* Early kernel, no 'new_offset' file,
* or kernel doesn't like us.
* For RAID5/6 this is not fatal
*/
return 1;