From 9ad2a640fe8579659455ef51b1fa40ea532e865f Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 21 May 2013 16:35:29 +1000 Subject: [PATCH] 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 --- Grow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Grow.c b/Grow.c index 3277649..5d35e32 100644 --- a/Grow.c +++ b/Grow.c @@ -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;