Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Apr 2026 01:16:42 +0800
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        "freebsd-stable@FreeBSD.org" <freebsd-stable@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: 14.3-RELEASE gpart show output (?.?T) vs. 14.4 and 15.0 and main: why do 14.4 and 15.0 and main have some single significant digit (?T) size figures?
Message-ID:  <0CB0C571-9D93-4DAA-B569-94E33D518EEA@FreeBSD.org>
In-Reply-To: <9441867F-E7A7-446A-ACE2-67287A7544D7@FreeBSD.org>
References:  <fe02b10d-8ab6-46dc-a27a-949eee37b490@yahoo.com> <68D25BCF-6B36-426D-B593-8391D6A5D5B1@FreeBSD.org> <DBC8687B-5CE0-460F-9D88-007218E37B84@FreeBSD.org> <41752629-5c40-4dd6-9b98-429f0a706250@yahoo.com> <9441867F-E7A7-446A-ACE2-67287A7544D7@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]


> On Apr 20, 2026, at 2:48 AM, Zhenlei Huang <zlei@FreeBSD.org> wrote:
> 
> 
> 
>> On Apr 20, 2026, at 2:03 AM, Mark Millard <marklmi@yahoo.com <mailto:marklmi@yahoo.com>> wrote:
>> 
>> On 4/19/26 10:40, Zhenlei Huang wrote:
>>> 
>>> 
>>>> On Apr 20, 2026, at 1:11 AM, Zhenlei Huang <zlei@FreeBSD.org <mailto:zlei@FreeBSD.org>
>>>> <mailto:zlei@FreeBSD.org <mailto:zlei@FreeBSD.org>>> wrote:
>>>> 
>>>> 
>>>> 
>>>>> On Apr 19, 2026, at 11:03 PM, Mark Millard <marklmi@yahoo.com <mailto:marklmi@yahoo.com>
>>>>> <mailto:marklmi@yahoo.com <mailto:marklmi@yahoo.com>>> wrote:
>>>>> 
>>>>> 14.3-RELEASE (more useful):
>>>>> 
>>>>> =>        40  1875384928    da1  GPT  (894G)
>>>>> =>        40  2930277095    nda1  GPT  (1.4T)
>>>>> =>        34  2930277101    da0  GPT  (1.4T)
>>>>> =>        34  3907029101    nda0  GPT  (1.8T)
>>>>> =>        34  4000797293    nda3  GPT  (1.9T)
>>>>> 
>>>>> 
>>>>> 14.4-RELEASE and 15.0-RELEASE and main (less useful):
>>>>> 
>>>>> =>        40  1875384928    da1  GPT  (894G)
>>>>> =>        40  2930277095    nda1  GPT  (1T)
>>>>> =>        34  2930277101    da0  GPT  (1T)
>>>>> =>        34  3907029101    nda0  GPT  (2T)
>>>>> =>        34  4000797293    nda3  GPT  (2T)
>>>>> 
>>>> 
>>>> It appears to be caused by 4f809ffec69c (gpart: add libxo support for
>>>> "show" subcommand + man page updates) .
>>>> 
>>>> Prior to the change the size was formatted to human friendly format by
>>>> `fmtsize(pp->lg_mediasize))` which in turn calls 
>>>> ```
>>>> humanize_number(buf, sizeof(buf), rawsz, "", HN_AUTOSCALE,
>>>>            HN_B | HN_NOSPACE | HN_DECIMAL);
>>>> ```,
>>>> 
>>>> now it is formatted with 
>>>> ```
>>>> xo_emit("  ({h:size/%jd})\n", (intmax_t)pp->lg_mediasize);
>>>> ```
>>>> 
>>>> It appears that libxo does not handle well with numbers those exceed
>>>> 10^12, ( 1 Terabyte in this case ).
>>> 
>>> Try this patch please, not a full fix for all the "size" column,
>>> 
>>> ```
>>> Author: Zhenlei Huang <zlei@FreeBSD.org <mailto:zlei@FreeBSD.org> <mailto:zlei@FreeBSD.org <mailto:zlei@FreeBSD.org>>>
>>> Date:   Mon Apr 20 01:38:21 2026 +0800
>>> 
>>>     geom_part: Fix the format of size
>>> 
>>> diff --git a/lib/geom/part/geom_part.c b/lib/geom/part/geom_part.c
>>> index 852eec2d790a..ca3c5f2c27c3 100644
>>> --- a/lib/geom/part/geom_part.c
>>> +++ b/lib/geom/part/geom_part.c
>>> @@ -723,7 +723,7 @@ gpart_show_geom(struct ggeom *gp, const char
>>> *element, int show_providers)
>>>                 }
>>>                 if (idx)
>>>                         xo_emit("]");
>>> -               xo_emit("  ({h:size/%jd})\n", (intmax_t)pp->lg_mediasize);
>>> +               xo_emit("  ({h,hn-decimal:size/%jd})\n", (intmax_t)pp-
>>>> lg_mediasize);
>>>                 xo_close_instance(s);
>>>                 first = end + 1;
>>>         }
>>> ```
>>> 
>>>> 
>>>>> 
>>>>> -- 
>>>>> ===
>>>>> Mark Millard
>>>>> marklmi at yahoo.com <http://yahoo.com/>; <http://yahoo.com/ <http://yahoo.com/>>;
>>>>> 
>>>>> 
>>>> 
>>>> Best regards,
>>>> Zhenlei
>>> 
>>> Best regards,
>>> Zhenlei
>>> 
>> 
>> I'm in the middle of other building-port-packages timing tests on the
>> systems. So I'll wait on doing the above.
> 
> See https://reviews.freebsd.org/D56514 <https://reviews.freebsd.org/D56514>; for the full patch.

Fixed in https://cgit.freebsd.org/src/commit/?id=0d16792c6e983005581ed0176ed81e7302582196 <https://cgit.freebsd.org/src/commit/?id=0d16792c6e983005581ed0176ed81e7302582196>; .

Thanks for your report !

> 
>> 
>> 
>> -- 
>> ===
>> Mark Millard
>> marklmi at yahoo.com <http://yahoo.com/>;
> 
> Best regards,
> Zhenlei




[-- Attachment #2 --]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 20, 2026, at 2:48 AM, Zhenlei Huang &lt;<a href="mailto:zlei@FreeBSD.org" class="">zlei@FreeBSD.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="Apple-interchange-newline"><br class=""><blockquote type="cite" class=""><div class="">On Apr 20, 2026, at 2:03 AM, Mark Millard &lt;<a href="mailto:marklmi@yahoo.com" class="">marklmi@yahoo.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 4/19/26 10:40, Zhenlei Huang wrote:<br class=""><blockquote type="cite" class=""><br class=""><br class=""><blockquote type="cite" class="">On Apr 20, 2026, at 1:11 AM, Zhenlei Huang &lt;<a href="mailto:zlei@FreeBSD.org" class="">zlei@FreeBSD.org</a><br class="">&lt;<a href="mailto:zlei@FreeBSD.org" class="">mailto:zlei@FreeBSD.org</a>&gt;&gt; wrote:<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Apr 19, 2026, at 11:03 PM, Mark Millard &lt;<a href="mailto:marklmi@yahoo.com" class="">marklmi@yahoo.com</a><br class="">&lt;<a href="mailto:marklmi@yahoo.com" class="">mailto:marklmi@yahoo.com</a>&gt;&gt; wrote:<br class=""><br class="">14.3-RELEASE (more useful):<br class=""><br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;40 &nbsp;1875384928 &nbsp;&nbsp;&nbsp;da1 &nbsp;GPT &nbsp;(894G)<br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;40 &nbsp;2930277095 &nbsp;&nbsp;&nbsp;nda1 &nbsp;GPT &nbsp;(1.4T)<br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34 &nbsp;2930277101 &nbsp;&nbsp;&nbsp;da0 &nbsp;GPT &nbsp;(1.4T)<br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34 &nbsp;3907029101 &nbsp;&nbsp;&nbsp;nda0 &nbsp;GPT &nbsp;(1.8T)<br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34 &nbsp;4000797293 &nbsp;&nbsp;&nbsp;nda3 &nbsp;GPT &nbsp;(1.9T)<br class=""><br class=""><br class="">14.4-RELEASE and 15.0-RELEASE and main (less useful):<br class=""><br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;40 &nbsp;1875384928 &nbsp;&nbsp;&nbsp;da1 &nbsp;GPT &nbsp;(894G)<br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;40 &nbsp;2930277095 &nbsp;&nbsp;&nbsp;nda1 &nbsp;GPT &nbsp;(1T)<br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34 &nbsp;2930277101 &nbsp;&nbsp;&nbsp;da0 &nbsp;GPT &nbsp;(1T)<br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34 &nbsp;3907029101 &nbsp;&nbsp;&nbsp;nda0 &nbsp;GPT &nbsp;(2T)<br class="">=&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34 &nbsp;4000797293 &nbsp;&nbsp;&nbsp;nda3 &nbsp;GPT &nbsp;(2T)<br class=""><br class=""></blockquote><br class="">It appears to be caused by 4f809ffec69c (gpart: add libxo support for<br class="">"show" subcommand + man page updates) .<br class=""><br class="">Prior to the change the size was formatted to human friendly format by<br class="">`fmtsize(pp-&gt;lg_mediasize))` which in turn calls&nbsp;<br class="">```<br class="">humanize_number(buf, sizeof(buf), rawsz, "", HN_AUTOSCALE,<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HN_B | HN_NOSPACE | HN_DECIMAL);<br class="">```,<br class=""><br class="">now it is formatted with&nbsp;<br class="">```<br class="">xo_emit(" &nbsp;({h:size/%jd})\n", (intmax_t)pp-&gt;lg_mediasize);<br class="">```<br class=""><br class="">It appears that libxo does not handle well with numbers those exceed<br class="">10^12, ( 1 Terabyte in this case ).<br class=""></blockquote><br class="">Try this patch please, not a full fix for all the "size" column,<br class=""><br class="">```<br class="">Author: Zhenlei Huang &lt;<a href="mailto:zlei@FreeBSD.org" class="">zlei@FreeBSD.org</a><span class="Apple-converted-space">&nbsp;</span>&lt;<a href="mailto:zlei@FreeBSD.org" class="">mailto:zlei@FreeBSD.org</a>&gt;&gt;<br class="">Date: &nbsp; Mon Apr 20 01:38:21 2026 +0800<br class=""><br class="">&nbsp; &nbsp; geom_part: Fix the format of size<br class=""><br class="">diff --git a/lib/geom/part/geom_part.c b/lib/geom/part/geom_part.c<br class="">index 852eec2d790a..ca3c5f2c27c3 100644<br class="">--- a/lib/geom/part/geom_part.c<br class="">+++ b/lib/geom/part/geom_part.c<br class="">@@ -723,7 +723,7 @@ gpart_show_geom(struct ggeom *gp, const char<br class="">*element, int show_providers)<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (idx)<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xo_emit("]");<br class="">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xo_emit(" &nbsp;({h:size/%jd})\n", (intmax_t)pp-&gt;lg_mediasize);<br class="">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xo_emit(" &nbsp;({h,hn-decimal:size/%jd})\n", (intmax_t)pp-<br class=""><blockquote type="cite" class="">lg_mediasize);<br class=""></blockquote>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xo_close_instance(s);<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; first = end + 1;<br class="">&nbsp; &nbsp; &nbsp; &nbsp; }<br class="">```<br class=""><br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class=""><br class="">--&nbsp;<br class="">===<br class="">Mark Millard<br class="">marklmi at&nbsp;<a href="http://yahoo.com/" class="">yahoo.com</a><span class="Apple-converted-space">&nbsp;</span>&lt;<a href="http://yahoo.com/" class="">http://yahoo.com/</a>&gt;<br class=""><br class=""><br class=""></blockquote><br class="">Best regards,<br class="">Zhenlei<br class=""></blockquote><br class="">Best regards,<br class="">Zhenlei<br class=""><br class=""></blockquote><br class="">I'm in the middle of other building-port-packages timing tests on the<br class="">systems. So I'll wait on doing the above.<br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">See<span class="Apple-converted-space">&nbsp;</span><a href="https://reviews.freebsd.org/D56514" class="">https://reviews.freebsd.org/D56514</a>&nbsp;for the full patch.</div></div></div></blockquote><div><br class=""></div><div>Fixed in&nbsp;<a href="https://cgit.freebsd.org/src/commit/?id=0d16792c6e983005581ed0176ed81e7302582196" class="">https://cgit.freebsd.org/src/commit/?id=0d16792c6e983005581ed0176ed81e7302582196</a>&nbsp;.</div><div><br class=""></div><div>Thanks for your report !</div><br class=""><blockquote type="cite" class=""><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><br class="">--<span class="Apple-converted-space">&nbsp;</span><br class="">===<br class="">Mark Millard<br class="">marklmi at<span class="Apple-converted-space">&nbsp;</span><a href="http://yahoo.com/" class="">yahoo.com</a><br class=""></div></div></blockquote></div><br class="" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div class="" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div class="">Best regards,</div><div class="">Zhenlei</div></div></div></blockquote></div><br class=""><div class="">
<div><br class=""></div>

</div>
<br class=""></body></html>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0CB0C571-9D93-4DAA-B569-94E33D518EEA>