Re: [PATCH RESEND] block: store GPT attributes as a raw value

From: Christoph Hellwig

Date: Thu Sep 10 2026 - 03:24:23 EST


On Tue, Sep 08, 2026 at 08:58:26PM +0200, Vincent Mailhol wrote:
> struct _gpt_entry_attributes currently models the GPT partition entry
> attributes field with bitfields. This is broken on machines using the
> __BIG_ENDIAN_BITFIELD ABI because GPT always stores the attributes on
> disk as a 64-bit little-endian.
>
> No current code consumes individual fields from that structure. So just
> remove struct _gpt_entry_attributes entirely and replace it by an __le64
> value in struct _gpt_entry instead. This lets users apply endian-aware
> masks explicitly when inspecting attribute bits.

This is much better. If we ever need to interpret it swe should use
le64_to_cpu and masking/shifting anyway.

Reviewed-by: Christoph Hellwig <hch@xxxxxx>