Bug 278418 - GEOM GPT partition table handling class defaults filling inconsistency.
Summary: GEOM GPT partition table handling class defaults filling inconsistency.
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-geom (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-17 20:35 UTC by andrew
Modified: 2024-04-18 00:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrew 2024-04-17 20:35:15 UTC
I'm neither GEOM hacker nor GPT expert, but as I can understand English language on one side and C programming language on another, comment in g_gpt_set_defaults() above alignment handling code and if() condition contradict with each other.

===
/*
 * Don't force alignment of any kind whatsoever on resize, restore or
   ~~~~~~~~~~~~~~~~~~~~~                        ~~ 
 * recover. resize doesn't go through this path, recover has a NULL gpp
   ~~~~~~~                                       ~~~~~~~~~~~~~~~~~~~~~~
 * and restore has flags == restore (maybe with an appended 'C' to
 * commit the operation). For these operations, we have to trust the
 * user knows what they are doing.
 . . . . . . . .
 */
===

===
if (gpp == NULL || ...

 . . . alignment handling code . . .
===

I think that condition should contain "gpp != NULL", shouldn't it?