]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm/mdstat: correct the strncmp number 4 as 6
authorZhilong Liu <zlliu@suse.com>
Mon, 9 Oct 2017 08:21:14 +0000 (16:21 +0800)
committerJes Sorensen <jsorensen@fb.com>
Tue, 10 Oct 2017 20:38:02 +0000 (16:38 -0400)
mdstat: it should be corrected as 6 when strncmp 'resync'.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
mdstat.c

index 6c906a7e7213543b252d8e458b44d2fae864d3f7..7e600d0cb03a7d072978226f5cd5cdab3a51f992 100644 (file)
--- a/mdstat.c
+++ b/mdstat.c
@@ -244,7 +244,7 @@ struct mdstat_ent *mdstat_read(int hold, int start)
                                        ent->resync = 0;
                        } else if (ent->percent == RESYNC_NONE &&
                                   (w[0] == 'r' || w[0] == 'c')) {
-                               if (strncmp(w, "resync", 4) == 0)
+                               if (strncmp(w, "resync", 6) == 0)
                                        ent->resync = 1;
                                if (strncmp(w, "reshape", 7) == 0)
                                        ent->resync = 2;