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 6/7] block: don't set GENHD_FL_NO_PART for hidden gendisks
Date: Thu, 10 Sep 2026 15:08:45 -0400 [thread overview]
Message-ID: <20260910190846.1453814-6-sashal@kernel.org> (raw)
In-Reply-To: <20260910190846.1453814-1-sashal@kernel.org>
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 9f18db572c97bc327b63528d195fdb252f47e9de ]
Hidden gendisks can't be opened using blkdev_get_*, so we can't really
reach any of the partition scanning paths or partitioning ioctls except
for the initial partition scan from add_disk.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211122130625.1136848-13-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Adapt the dependency to the 5.10 disk-registration layout. Keep the void
disk_scan_partitions() interface and its capacity and partition-scan
checks, adding a direct GENHD_FL_HIDDEN check before requesting a scan.
Remove the implicit GENHD_FL_NO_PART assignment from __device_add_disk(),
where this branch handles hidden disks. Preserve its existing BDI and
region registration, and keep register_disk()'s hidden-disk early return,
uevents and sysfs links intact. No functions are added.
Verified that target 3f9c7a108c0e applies cleanly with a three-way merge,
placing 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 | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 4ecab2f503719..ea81203f6a036 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -680,7 +680,8 @@ static void disk_scan_partitions(struct gendisk *disk)
{
struct block_device *bdev;
- if (!get_capacity(disk) || !disk_part_scan_enabled(disk))
+ if (!get_capacity(disk) || !disk_part_scan_enabled(disk) ||
+ (disk->flags & GENHD_FL_HIDDEN))
return;
set_bit(GD_NEED_PART_SCAN, &disk->state);
@@ -745,12 +746,7 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk,
disk_alloc_events(disk);
- if (disk->flags & GENHD_FL_HIDDEN) {
- /*
- * Don't bother scanning for partitions.
- */
- disk->flags |= GENHD_FL_NO_PART;
- } else {
+ if (!(disk->flags & GENHD_FL_HIDDEN)) {
struct backing_dev_info *bdi = disk->queue->backing_dev_info;
struct device *dev = disk_to_dev(disk);
int ret;
--
2.53.0
next prev 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 ` [PATCH 5.10.y 5/7] block: remove 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 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-6-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.