]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
error check reading of 'degraded' from sysfs.
authorNeilBrown <neilb@suse.de>
Thu, 20 Jan 2011 21:59:00 +0000 (08:59 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 20 Jan 2011 21:59:00 +0000 (08:59 +1100)
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 <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index bf8e8ad358ee5c46968b41fbd83428ca03c49cc5..14701bdcb0578acd1c84edc4920b68049c001f28 100644 (file)
--- 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 */