From 2c6ac128c4e9057c9afcdf4097b92488466e52fc Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 21 Jan 2011 08:59:00 +1100 Subject: [PATCH] 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 --- Grow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Grow.c b/Grow.c index bf8e8ad..14701bd 100644 --- a/Grow.c +++ b/Grow.c @@ -2495,7 +2495,8 @@ static int grow_backup(struct mdinfo *sra, 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 */