From: John Garry When flag GENHD_FL_HIDDEN is set for a disk, normally the partition table were not available and so we won't get its partitions showing in diskstats. However, now hidden disks may have partition tables. The diskstats for partitions on disks with GENHD_FL_HIDDEN can bloat the output and is not too interesting, so always hide it. Signed-off-by: John Garry --- block/genhd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index 79cf26e8f5dbe..896369a96f96c 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1388,7 +1388,8 @@ static int diskstats_show(struct seq_file *seqf, void *v) rcu_read_lock(); xa_for_each(&gp->part_tbl, idx, hd) { - if (bdev_is_partition(hd) && !bdev_nr_sectors(hd)) + if (bdev_is_partition(hd) && + (!bdev_nr_sectors(hd) || (gp->flags & GENHD_FL_HIDDEN))) continue; inflight = bdev_count_inflight(hd); -- 2.43.7