From: John Garry <john.g.garry@oracle.com>
To: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
John Garry <john.garry@linux.dev>,
John Garry <john.g.garry@oracle.com>
Subject: [PATCH RFC v3 2/3] block: don't show partition diskstats for GENHD_FL_HIDDEN
Date: Fri, 21 Aug 2026 08:48:30 +0000 [thread overview]
Message-ID: <20260821084831.4155943-3-john.g.garry@oracle.com> (raw)
In-Reply-To: <20260821084831.4155943-1-john.g.garry@oracle.com>
From: John Garry <john.garry@linux.dev>
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 <john.g.garry@oracle.com>
---
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
prev parent reply other threads:[~2026-08-21 8:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 8:48 [PATCH RFC v3 0/3] fix NVMe multipath partition diskstats John Garry
2026-08-21 8:48 ` [PATCH RFC v3 1/3] block: support linking disks to clone partitions John Garry
2026-08-21 8:48 ` John Garry [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260821084831.4155943-3-john.g.garry@oracle.com \
--to=john.g.garry@oracle.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=john.garry@linux.dev \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox