]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Manage.c
sysfs: Parse array_state in sysfs_read()
[thirdparty/mdadm.git] / Manage.c
index bb84d28409bb2a86533b1602e4bbace8d5f854cf..8966e3368d1e3c7b47de9d6a19e93b5aadf46351 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -929,7 +929,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
                        return -1;
                }
 
-               if (strncmp(mdp->sysfs_array_state, "readonly", 8) != 0) {
+               if (mdp->array_state != ARRAY_READONLY) {
                        sysfs_free(mdp);
                        pr_err("%s is not readonly, cannot add journal.\n", devname);
                        return -1;