Date: Mon, 20 Apr 2026 01:40:48 +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: <DBC8687B-5CE0-460F-9D88-007218E37B84@FreeBSD.org> In-Reply-To: <68D25BCF-6B36-426D-B593-8391D6A5D5B1@FreeBSD.org> References: <fe02b10d-8ab6-46dc-a27a-949eee37b490@yahoo.com> <68D25BCF-6B36-426D-B593-8391D6A5D5B1@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
> On Apr 20, 2026, at 1:11 AM, Zhenlei Huang <zlei@FreeBSD.org> wrote:
>
>
>
>> On Apr 19, 2026, at 11:03 PM, Mark Millard <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>
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/>
>>
>>
>
> Best regards,
> Zhenlei
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 1:11 AM, Zhenlei Huang <<a href="mailto:zlei@FreeBSD.org" class="">zlei@FreeBSD.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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 style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">On Apr 19, 2026, at 11:03 PM, Mark Millard <<a href="mailto:marklmi@yahoo.com" class="">marklmi@yahoo.com</a>> wrote:<br class=""><br class="">14.3-RELEASE (more useful):<br class=""><br class="">=> 40 1875384928 da1 GPT (894G)<br class="">=> 40 2930277095 nda1 GPT (1.4T)<br class="">=> 34 2930277101 da0 GPT (1.4T)<br class="">=> 34 3907029101 nda0 GPT (1.8T)<br class="">=> 34 4000797293 nda3 GPT (1.9T)<br class=""><br class=""><br class="">14.4-RELEASE and 15.0-RELEASE and main (less useful):<br class=""><br class="">=> 40 1875384928 da1 GPT (894G)<br class="">=> 40 2930277095 nda1 GPT (1T)<br class="">=> 34 2930277101 da0 GPT (1T)<br class="">=> 34 3907029101 nda0 GPT (2T)<br class="">=> 34 4000797293 nda3 GPT (2T)<br class=""><br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">It appears to be caused by 4f809ffec69c (gpart: add libxo support for "show" subcommand + man page updates) .</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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 style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">Prior to the change the size was formatted to human friendly format by `fmtsize(pp->lg_mediasize))` which in turn calls<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">```</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">humanize_number(buf, sizeof(buf), rawsz, "", HN_AUTOSCALE,</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class=""> HN_B | HN_NOSPACE | HN_DECIMAL);</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">```,</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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 style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">now it is formatted with<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">```</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">xo_emit(" ({h:size/%jd})\n", (intmax_t)pp->lg_mediasize);</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">```</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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 style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">It appears that libxo does not handle well with numbers those exceed 10^12, ( 1 Terabyte in this case ).</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""></div></blockquote><div><br class=""></div><div>Try this patch please, not a full fix for all the "size" column,</div><div><br class=""></div><div>```</div><div><div>Author: Zhenlei Huang <<a href="mailto:zlei@FreeBSD.org" class="">zlei@FreeBSD.org</a>></div><div>Date: Mon Apr 20 01:38:21 2026 +0800</div><div><br class=""></div><div> geom_part: Fix the format of size</div><div><br class=""></div><div>diff --git a/lib/geom/part/geom_part.c b/lib/geom/part/geom_part.c</div><div>index 852eec2d790a..ca3c5f2c27c3 100644</div><div>--- a/lib/geom/part/geom_part.c</div><div>+++ b/lib/geom/part/geom_part.c</div><div>@@ -723,7 +723,7 @@ gpart_show_geom(struct ggeom *gp, const char *element, int show_providers)</div><div> }</div><div> if (idx)</div><div> xo_emit("]");</div><div>- xo_emit(" ({h:size/%jd})\n", (intmax_t)pp->lg_mediasize);</div><div>+ xo_emit(" ({h,hn-decimal:size/%jd})\n", (intmax_t)pp->lg_mediasize);</div><div> xo_close_instance(s);</div><div> first = end + 1;</div><div> }</div></div><div>```</div><br class=""><blockquote type="cite" class=""><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="">--<span class="Apple-converted-space"> </span><br class="">===<br class="">Mark Millard<br class="">marklmi at<span class="Apple-converted-space"> </span><a href="http://yahoo.com/" class="">yahoo.com</a><br class=""><br class=""><br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">Best regards,</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; 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; float: none; display: inline !important;" class="">Zhenlei</span></div></blockquote></div><br class=""><div class="">
<div>Best regards,</div><div>Zhenlei</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?DBC8687B-5CE0-460F-9D88-007218E37B84>
