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 1/7] block: remove a dead check in show_partition
Date: Thu, 10 Sep 2026 15:08:40 -0400 [thread overview]
Message-ID: <20260910190846.1453814-1-sashal@kernel.org> (raw)
In-Reply-To: <2026090834-voyage-donut-60bd@gregkh>
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit e3b3bad3f29878d13fdbc96f9e59674bd9b06bae ]
disk_max_parts never returns 0 given that ->minors for devices not using
the extended dev_t must be non-zero, and disk_max_parts always returns
DISK_MAX_PARTS for the latter.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211122130625.1136848-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: 3f9c7a108c0e ("block: flag zoned disks with GENHD_FL_NO_PART")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/genhd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 768a49460bf19..01a7b81eca751 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1174,9 +1174,7 @@ static int show_partition(struct seq_file *seqf, void *v)
struct hd_struct *part;
char buf[BDEVNAME_SIZE];
- /* Don't show non-partitionable removeable devices or empty devices */
- if (!get_capacity(sgp) || (!disk_max_parts(sgp) &&
- (sgp->flags & GENHD_FL_REMOVABLE)))
+ if (!get_capacity(sgp))
return 0;
if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)
return 0;
--
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 ` Sasha Levin [this message]
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 ` [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-1-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.