All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] md: do not count journal as spare in GET_ARRAY_INFO
@ 2016-08-12  0:14 Song Liu
  2016-08-17  1:33 ` Shaohua Li
  0 siblings, 1 reply; 2+ messages in thread
From: Song Liu @ 2016-08-12  0:14 UTC (permalink / raw)
  To: linux-raid; +Cc: yizhan, Song Liu, Shaohua Li

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 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2c3ab6f..df595a8 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -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++;
 		}
-- 
2.8.0.rc2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-17  1:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-12  0:14 [PATCH] md: do not count journal as spare in GET_ARRAY_INFO Song Liu
2016-08-17  1:33 ` Shaohua Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.