[md PATCH 09/18] md/raid10: stop print_conf from being too verbose.

NeilBrown
2016-06-02T06:19:52Z

raid10 arrays can usefully be very large. When they are, the noise generated by print_conf
can over-whelm logs.
So truncate the listing at 16 devices.

Signed-off-by: NeilBrown <neilb@suse.com>
---
drivers/md/raid10.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 61091ab02a4b..5d40612d6219 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1610,7 +1610,7 @@ static void print_conf(struct r10conf *conf)

/* This is only called with ->reconfix_mutex held, so
* rcu protection of rdev is not needed */
- for (i = 0; i < conf->geo.raid_disks; i++) {
+ for (i = 0; i < conf->geo.raid_disks && i < 16; i++) {
char b[BDEVNAME_SIZE];
rdev = conf->mirrors[i].rdev;
if (rdev)
@@ -1619,6 +1619,8 @@ static void print_conf(struct r10conf *conf)
!test_bit(Faulty, &rdev->flags),
bdevname(rdev->bdev,b));
}
+ if (conf->geo.raid_disks > 16)
+ printk(KERN_DEBUG " remaining devices excluded for brevity\n");
}

static void close_sync(struct r10conf *conf)