From: Vincent Mailhol <mailhol@kernel.org>
To: Jens Axboe <axboe@kernel.dk>, Davidlohr Bueso <dave@stgolabs.net>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
linux-efi@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Dave Hansen <dave.hansen@intel.com>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Helge Deller <deller@gmx.de>,
Matthew Wilcox <willy@infradead.org>,
Vincent Mailhol <mailhol@kernel.org>
Subject: [PATCH v2 5/7] block: skip partitions with DPS no-auto GPT attribute
Date: Sun, 25 Oct 2026 14:03:15 +0100 [thread overview]
Message-ID: <20261025-discoverable-root_partitions-v2-5-fb77d0821fab@kernel.org> (raw)
In-Reply-To: <20261025-discoverable-root_partitions-v2-0-fb77d0821fab@kernel.org>
DPS [1] defines GPT attribute bit 63 as no-auto. Partitions with this
bit set must not be used by automatic discovery.
Store the GPT attributes in partition_meta_info and check
GPT_ATTR_NO_AUTO_DISCOVERY when matching a root partition by type UUID.
[1] The Discoverable Partitions Specification (DPS)
Link: https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
---
block/early-lookup.c | 1 +
block/partitions/efi.c | 1 +
include/linux/blkdev.h | 4 ++++
3 files changed, 6 insertions(+)
diff --git a/block/early-lookup.c b/block/early-lookup.c
index a1cb67eab4a0..6c9664eeeb1b 100644
--- a/block/early-lookup.c
+++ b/block/early-lookup.c
@@ -261,6 +261,7 @@ static int __init match_dev_by_type_uuid(struct device *dev, const void *data)
const struct uuidcmp *cmp = data;
return bdev->bd_disk == cmp->disk && bdev->bd_meta_info &&
+ !(bdev->bd_meta_info->gpt_attr & GPT_ATTR_NO_AUTO_DISCOVERY) &&
!strcasecmp(cmp->uuid, bdev->bd_meta_info->type_uuid);
}
diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index 4a3835ed9561..ed5e2f21ad85 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -741,6 +741,7 @@ int efi_partition(struct parsed_partitions *state)
state->parts[i + 1].flags = ADDPART_FLAG_RAID;
info = &state->parts[i + 1].info;
+ info->gpt_attr = le64_to_cpu(ptes[i].attributes);
efi_guid_to_str(&ptes[i].unique_partition_guid, info->uuid);
efi_guid_to_str(&ptes[i].partition_type_guid, info->type_uuid);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 52bd5683da77..629ddf1b8b7a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -5,6 +5,7 @@
#ifndef _LINUX_BLKDEV_H
#define _LINUX_BLKDEV_H
+#include <linux/bits.h>
#include <linux/types.h>
#include <linux/blk_types.h>
#include <linux/blk_plug.h>
@@ -65,10 +66,13 @@ extern const struct class block_class;
*/
#define PARTITION_META_INFO_UUIDLTH (UUID_STRING_LEN + 1)
+#define GPT_ATTR_NO_AUTO_DISCOVERY BIT_U64(63)
+
struct partition_meta_info {
char uuid[PARTITION_META_INFO_UUIDLTH];
char type_uuid[PARTITION_META_INFO_UUIDLTH];
u8 volname[PARTITION_META_INFO_VOLNAMELTH];
+ u64 gpt_attr;
};
/**
--
2.55.0
next prev parent reply other threads:[~2026-10-25 13:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 13:03 [PATCH v2 0/7] init: discoverable root partitions Vincent Mailhol
2026-10-25 13:03 ` [PATCH v2 1/7] block: store GPT partition type UUID Vincent Mailhol
2026-10-25 13:03 ` [PATCH v2 2/7] init: add DPS root partition type UUID definitions Vincent Mailhol
2026-10-25 13:13 ` sashiko-bot
2026-10-25 15:45 ` Vincent Mailhol
2026-10-25 13:03 ` [PATCH v2 3/7] init: factor out root device lookup into lookup_root_device() Vincent Mailhol
2026-10-25 13:03 ` [PATCH v2 4/7] init: discover root by DPS partition type UUID Vincent Mailhol
2026-10-25 13:03 ` Vincent Mailhol [this message]
2026-10-25 13:03 ` [PATCH v2 6/7] init: add secondary DPS root " Vincent Mailhol
2026-10-25 13:03 ` [PATCH v2 7/7] docs: document discoverable root partitions Vincent Mailhol
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=20261025-discoverable-root_partitions-v2-5-fb77d0821fab@kernel.org \
--to=mailhol@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=dave.hansen@intel.com \
--cc=dave@stgolabs.net \
--cc=deller@gmx.de \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox