From: NeilBrown Date: Thu, 20 Jan 2011 21:59:00 +0000 (+1100) Subject: error check reading of 'degraded' from sysfs. X-Git-Tag: mdadm-3.1.5~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5101e4681fd58566cddf500d48f9ee80067ece17;p=thirdparty%2Fmdadm.git error check reading of 'degraded' from sysfs. I'm seen mdadm spinning while failing to read 'degraded'. This doesn't really fix it, but is a reminder that it needs to be fixed. Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 7db54de2..bcd77ac9 100644 --- a/Grow.c +++ b/Grow.c @@ -1293,7 +1293,8 @@ int grow_backup(struct mdinfo *sra, odata--; sysfs_set_num(sra, NULL, "suspend_hi", (offset + stripes * (chunk/512)) * odata); /* Check that array hasn't become degraded, else we might backup the wrong data */ - sysfs_get_ll(sra, NULL, "degraded", &ll); + if (sysfs_get_ll(sra, NULL, "degraded", &ll) < 0) + return -1; /* FIXME this error is ignored */ new_degraded = (int)ll; if (new_degraded != *degraded) { /* check each device to ensure it is still working */