md: do not count journal as spare in GET_ARRAY_INFO
authorSong Liu <songliubraving@fb.com>
Fri, 12 Aug 2016 00:14:45 +0000 (17:14 -0700)
committerShaohua Li <shli@fb.com>
Wed, 17 Aug 2016 01:34:15 +0000 (18:34 -0700)
GET_ARRAY_INFO counts journal as spare (spare_disks), which is not
accurate. This patch fixes this.

Reported-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.c

index 2c3ab6f5e6bef01f0b358b65daf78a51442cc07a..d750b52376b97f871663dd2e9bb931da84932b2b 100644 (file)
@@ -5851,6 +5851,9 @@ static int get_array_info(struct mddev *mddev, void __user *arg)
                        working++;
                        if (test_bit(In_sync, &rdev->flags))
                                insync++;
+                       else if (test_bit(Journal, &rdev->flags))
+                               /* TODO: add journal count to md_u.h */
+                               ;
                        else
                                spare++;
                }