All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10.y 5/7] block: remove GENHD_FL_SUPPRESS_PARTITION_INFO
Date: Thu, 10 Sep 2026 15:08:44 -0400	[thread overview]
Message-ID: <20260910190846.1453814-5-sashal@kernel.org> (raw)
In-Reply-To: <20260910190846.1453814-1-sashal@kernel.org>

From: Christoph Hellwig <hch@lst.de>

[ Upstream commit 3b5149ac50970669ee0ddb9629ec77ffd5c0622d ]

This flag is not set directly anywhere and only inherited from
GENHD_FL_HIDDEN.  Just check for GENHD_FL_HIDDEN instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211122130625.1136848-11-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Adapt the dependency to the 5.10 disk-registration layout.  Remove the
hidden-disk suppression assignment from __device_add_disk(), where this
branch sets GENHD_FL_NO_PART, and keep register_disk() and its existing
uevent and backing-device registration flow intact.

Preserve GENHD_FL_CD, GENHD_FL_UP, GENHD_FL_NATIVE_CAPACITY and
GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE, which are still used on this branch.
Only remove GENHD_FL_SUPPRESS_PARTITION_INFO and check GENHD_FL_HIDDEN
in both partition-listing paths.  No functions are added.

The preceding dependencies already removed the MMC and null_blk users.
Verified that target 3f9c7a108c0e applies cleanly with a three-way merge,
inserting its zoned-disk check in __device_add_disk() before partition
scanning.  The existing GENHD_FL_NO_PART ext_range handling is retained.

Stable-dep-of: 3f9c7a108c0e ("block: flag zoned disks with GENHD_FL_NO_PART")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/genhd.c         | 11 +++--------
 include/linux/genhd.h |  9 +--------
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index fef31a2f50a80..4ecab2f503719 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -747,10 +747,8 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk,
 
 	if (disk->flags & GENHD_FL_HIDDEN) {
 		/*
-		 * Don't let hidden disks show up in /proc/partitions,
-		 * and don't bother scanning for partitions either.
+		 * Don't bother scanning for partitions.
 		 */
-		disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
 		disk->flags |= GENHD_FL_NO_PART;
 	} else {
 		struct backing_dev_info *bdi = disk->queue->backing_dev_info;
@@ -1086,8 +1084,7 @@ void __init printk_all_partitions(void)
 		 * Don't show empty devices or things that have been
 		 * suppressed
 		 */
-		if (get_capacity(disk) == 0 ||
-		    (disk->flags & GENHD_FL_SUPPRESS_PARTITION_INFO))
+		if (get_capacity(disk) == 0 || (disk->flags & GENHD_FL_HIDDEN))
 			continue;
 
 		/*
@@ -1182,9 +1179,7 @@ static int show_partition(struct seq_file *seqf, void *v)
 	struct hd_struct *part;
 	char buf[BDEVNAME_SIZE];
 
-	if (!get_capacity(sgp))
-		return 0;
-	if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)
+	if (!get_capacity(sgp) || (sgp->flags & GENHD_FL_HIDDEN))
 		return 0;
 
 	/* show the full disk and all non-0 size partitions of it */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 30e1841630b1f..d6892e2f31c37 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -92,11 +92,6 @@ struct hd_struct {
  * ``GENHD_FL_UP`` (0x0010): indicates that the block device is "up",
  * with a similar meaning to network interfaces.
  *
- * ``GENHD_FL_SUPPRESS_PARTITION_INFO`` (0x0020): don't include
- * partition information in ``/proc/partitions`` or in the output of
- * printk_all_partitions().
- * Used for the null block device and some MMC devices.
- *
  * ``GENHD_FL_EXT_DEVT`` (0x0040): the driver supports extended
  * dynamic ``dev_t``, i.e. it wants extended device numbers
  * (``BLOCK_EXT_MAJOR``).
@@ -118,8 +113,7 @@ struct hd_struct {
  * ``GENHD_FL_HIDDEN`` (0x0400): the block device is hidden; it
  * doesn't produce events, doesn't appear in sysfs, and doesn't have
  * an associated ``bdev``.
- * Implies ``GENHD_FL_SUPPRESS_PARTITION_INFO`` and
- * ``GENHD_FL_NO_PART``.
+ * Implies ``GENHD_FL_NO_PART``.
  * Used for multipath devices.
  */
 #define GENHD_FL_REMOVABLE			0x0001
@@ -127,7 +121,6 @@ struct hd_struct {
 /* 4 is unused (used to be GENHD_FL_MEDIA_CHANGE_NOTIFY) */
 #define GENHD_FL_CD				0x0008
 #define GENHD_FL_UP				0x0010
-#define GENHD_FL_SUPPRESS_PARTITION_INFO	0x0020
 #define GENHD_FL_EXT_DEVT			0x0040
 #define GENHD_FL_NATIVE_CAPACITY		0x0080
 #define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE	0x0100
-- 
2.53.0


  parent reply	other threads:[~2026-09-10 19:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 13:38 FAILED: patch "[PATCH] block: flag zoned disks with GENHD_FL_NO_PART" failed to apply to 5.10-stable tree gregkh
2026-09-10 19:08 ` [PATCH 5.10.y 1/7] block: remove a dead check in show_partition Sasha Levin
2026-09-10 19:08   ` [PATCH 5.10.y 2/7] block: rename GENHD_FL_NO_PART_SCAN to GENHD_FL_NO_PART Sasha Levin
2026-09-10 19:08   ` [PATCH 5.10.y 3/7] null_blk: don't suppress partitioning information Sasha Levin
2026-09-10 19:08   ` [PATCH 5.10.y 4/7] mmc: don't set GENHD_FL_SUPPRESS_PARTITION_INFO Sasha Levin
2026-09-10 19:08   ` Sasha Levin [this message]
2026-09-10 19:08   ` [PATCH 5.10.y 6/7] block: don't set GENHD_FL_NO_PART for hidden gendisks Sasha Levin
2026-09-10 19:08   ` [PATCH 5.10.y 7/7] block: flag zoned disks with GENHD_FL_NO_PART Sasha Levin

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=20260910190846.1453814-5-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=stable@vger.kernel.org \
    /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 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.