]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Grow.c
error check reading of 'degraded' from sysfs.
[thirdparty/mdadm.git] / Grow.c
diff --git a/Grow.c b/Grow.c
index 7db54de2b1362f5d7b6673a59225ac1fb993cb04..bcd77ac90f89d3e56293f1390a00fa9a9aa22995 100644 (file)
--- 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 */