Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Nov 2022 08:54:33 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Alexander Leidinger <Alexander@leidinger.net>
Cc:        marklmi@yahoo.com, tsoome@freebsd.org, Li-Wen Hsu <lwhsu@freebsd.org>,  current@freebsd.org
Subject:   Re: changes to the zfs boot (was: Re: git: 72a1cb05cd23 - main - rc(8): Add a zpoolupgrade rc.d script)
Message-ID:  <CANCZdfptmipq%2BsS0AQ1%2B7EmLT-7YdKv8s%2BnCV7ON1Qy6-C6N9A@mail.gmail.com>
In-Reply-To: <20221109134610.Horde.JB7ibQTWprHbmIUfhg7JY7f@webmail.leidinger.net>
References:  <202211070339.2A73dJlO027991@gitrepo.freebsd.org> <20221107121514.Horde.nulS9Wg1s3yzAsXXkuJRBa9@webmail.leidinger.net> <CANCZdfrdc%2BDbv6sDyDLcWNpXnWScEmpUsGu3q8%2BMbZRjDS8eig@mail.gmail.com> <20221108105053.Horde.eqgFiBJe2ngGAj6BkXcv5-Z@webmail.leidinger.net> <20221109134610.Horde.JB7ibQTWprHbmIUfhg7JY7f@webmail.leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000e37acf05ed0bacb8
Content-Type: text/plain; charset="UTF-8"

On Wed, Nov 9, 2022 at 5:46 AM Alexander Leidinger <Alexander@leidinger.net>
wrote:

> Quoting Alexander Leidinger <Alexander@leidinger.net> (from Tue, 08
> Nov 2022 10:50:53 +0100):
>
> > Quoting Warner Losh <imp@bsdimp.com> (from Mon, 7 Nov 2022 14:23:11
> -0700):
> >
> >>
> >>
> >>       On Mon, Nov 7, 2022 at 4:15 AM Alexander Leidinger
> >> <Alexander@leidinger.net> wrote:
> >>
> >>> Quoting Li-Wen Hsu <lwhsu@freebsd.org> (from Mon, 7 Nov 2022 03:39:19
> GMT):
> >>>
> >>>> The branch main has been updated by lwhsu:
> >>>>
> >>>> URL:
> >>>>
> https://cgit.FreeBSD.org/src/commit/?id=72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d
> >>>>
> >>>> commit 72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d
> >>>> Author:     Li-Wen Hsu <lwhsu@FreeBSD.org>
> >>>> AuthorDate: 2022-11-07 03:30:09 +0000
> >>>> Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
> >>>> CommitDate: 2022-11-07 03:30:09 +0000
> >>>>
> >>>>      rc(8): Add a zpoolupgrade rc.d script
> >>>>
> >>>>      If a zpool is created by makefs(8), its version is 5000, i.e.,
> all
> >>>>      feature flags are off.  Introduce an rc script to run `zpool
> upgrade`
> >>>>      over the assigned zpools on the first boot.  This is useful to
> the
> >>>>      ZFS based VM images built from release(7).
> >>>
> >>>> diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
> >>>> index f9ceabc83120..43fa44a5f1cb 100644
> >>>> --- a/share/man/man5/rc.conf.5
> >>>> +++ b/share/man/man5/rc.conf.5
> >>>> @@ -24,7 +24,7 @@
> >>>>   .\"
> >>>>   .\" $FreeBSD$
> >>>>   .\"
> >>>> -.Dd August 28, 2022
> >>>> +.Dd November 7, 2022
> >>>>   .Dt RC.CONF 5
> >>>>   .Os
> >>>>   .Sh NAME
> >>>> @@ -2109,6 +2109,13 @@ A space-separated list of ZFS pool names for
> >>>> which new pool GUIDs should be
> >>>>   assigned upon first boot.
> >>>>   This is useful when using a ZFS pool copied from a template, such
> >>>> as a virtual
> >>>>   machine image.
> >>>> +.It Va zpool_upgrade
> >>>> +.Pq Vt str
> >>>> +A space-separated list of ZFS pool names for which version should
> >>>> be upgraded
> >>>> +upon first boot.
> >>>> +This is useful when using a ZFS pool generated by
> >>>> +.Xr makefs 8
> >>>> +utility.
> >>>
> >>> For someone who knows ZFS well, it is clear that only a zpool upgrade
> >>> is done. Not so experienced people may assume there is a combination
> >>> of zpool upgrade and zfs upgrade (more so for people which do not know
> >>> what the difference is). Maybe you want to add some explicit
> >>> documentation, that zfs upgrade + feature flags needs to be done by
> >>> hand.
> >>>
> >>> And this brings me to a second topic, we don't have an explicit list
> >>> of features which are supported by the bootloader (I had a look at the
> >>> zfs and the boot related man pages, if I overlooked a place, then the
> >>> other places should reference this important part with some text).
> >>
> >>
> >>    There is a fixed list of features we support in the boot loader:
> >>
> >>    /*
> >>  * List of ZFS features supported for read
> >>  */
> >> static const char *features_for_read[] = {
> >>         "org.illumos:lz4_compress",
> >>         "com.delphix:hole_birth",
> >>         "com.delphix:extensible_dataset",
> >>         "com.delphix:embedded_data",
> >>         "org.open-zfs:large_blocks",
> >>         "org.illumos:sha512",
> >>         "org.illumos:skein",
> >>         "org.zfsonlinux:large_dnode",
> >>         "com.joyent:multi_vdev_crash_dump",
> >>         "com.delphix:spacemap_histogram",
> >>         "com.delphix:zpool_checkpoint",
> >>         "com.delphix:spacemap_v2",
> >>         "com.datto:encryption",
> >>         "com.datto:bookmark_v2",
> >>         "org.zfsonlinux:allocation_classes",
> >>         "com.datto:resilver_defer",
> >>         "com.delphix:device_removal",
> >>         "com.delphix:obsolete_counts",
> >>         "com.intel:allocation_classes",
> >>         "org.freebsd:zstd_compress",
> >>         "com.delphix:bookmark_written",
> >>         "com.delphix:head_errlog",
> >>         "org.openzfs:blake3",
> >>         NULL
> >> };
> >>
> >>    Any feature not on this list will cause the boot loader to
> >> reject the pool.
> >>
> >>    Whether or not it should do that by default, always, or never is an
> open
> >>    question. I've thought there should be a 'shoot footing'
> >> override that isn't
> >>    there today.
> >>
> >
> > Thanks for the list. For those interested, it is in
> >     $SRC/stand/libsa/zfs/zfsimpl.c
> >
> > Just to make my opinion expressed before explicit again, this should
> > be documented in a boot / bootloader related man-page, but isn't.
> >
> > Should the above list be sorted in some way? Maybe in the same order
> > as the zpool-features lists them (sort by feature name after the
> > colon), or alphabetical?
>
> Is it OK if I commit this alphabetical sorting?
> ---snip---
> diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c
> index 6b961f3110a..36c90613e82 100644
> --- a/stand/libsa/zfs/zfsimpl.c
> +++ b/stand/libsa/zfs/zfsimpl.c
> @@ -118,29 +118,29 @@ static vdev_list_t zfs_vdevs;
>    * List of ZFS features supported for read
>    */
>   static const char *features_for_read[] = {
> -        "org.illumos:lz4_compress",
> -        "com.delphix:hole_birth",
> -        "com.delphix:extensible_dataset",
> -        "com.delphix:embedded_data",
> -        "org.open-zfs:large_blocks",
> -        "org.illumos:sha512",
> -        "org.illumos:skein",
> -        "org.zfsonlinux:large_dnode",
> -        "com.joyent:multi_vdev_crash_dump",
> -        "com.delphix:spacemap_histogram",
> -        "com.delphix:zpool_checkpoint",
> -        "com.delphix:spacemap_v2",
> -        "com.datto:encryption",
>           "com.datto:bookmark_v2",
> -        "org.zfsonlinux:allocation_classes",
> +        "com.datto:encryption",
>           "com.datto:resilver_defer",
> +        "com.delphix:bookmark_written",
>           "com.delphix:device_removal",
> +        "com.delphix:embedded_data",
> +        "com.delphix:extensible_dataset",
> +        "com.delphix:head_errlog",
> +        "com.delphix:hole_birth",
>           "com.delphix:obsolete_counts",
> +        "com.delphix:spacemap_histogram",
> +        "com.delphix:spacemap_v2",
> +        "com.delphix:zpool_checkpoint",
>           "com.intel:allocation_classes",
> +        "com.joyent:multi_vdev_crash_dump",
>           "org.freebsd:zstd_compress",
> -        "com.delphix:bookmark_written",
> -        "com.delphix:head_errlog",
> +        "org.illumos:lz4_compress",
> +        "org.illumos:sha512",
> +        "org.illumos:skein",
> +        "org.open-zfs:large_blocks",
>           "org.openzfs:blake3",
> +        "org.zfsonlinux:allocation_classes",
> +        "org.zfsonlinux:large_dnode",
>           NULL
>   };
> ---snip---
>

This patch looks good because it's a nop and just tidies things up a bit.

Reviewed by: imp


> > As Mark already mentioned some flags, I checked the features marked
> > as read only (I checked in the zpool-features man page, including
> > the dependencies documented there) and here are those not listed in
> > zfsimpl.c. I would assume as they are read-only compatible, we
> > should add them:
> >     com.delphix:async_destroy
> >     com.delphix:bookmarks
> >     org.openzfs:device_rebuild
> >     com.delphix:empty_bpobj
> >     com.delphix:enable_txg
> >     com.joyent:filesystem_limits
> >     com.delphix:livelist
> >     com.delphix:log_spacemap
> >     com.zfsonlinux:project_quota
> >     com.zfsonlinux:userobj_accounting
> >     com.openzfs:zilsaxattr
>
> If my understanding is correct that the read-only compatible parts
> (according to the zpool-features man page) are safe to add to the zfs
> boot, here is what I have only build-tested (relative to the above
> alphabetical sorting):
> ---snip---
> --- zfsimpl.c_sorted        2022-11-09 12:55:06.346083000 +0100
> +++ zfsimpl.c        2022-11-09 13:01:24.083364000 +0100
> @@ -121,24 +121,35 @@
>           "com.datto:bookmark_v2",
>           "com.datto:encryption",
>           "com.datto:resilver_defer",
> +        "com.delphix:async_destroy",
>           "com.delphix:bookmark_written",
> +        "com.delphix:bookmarks",
>           "com.delphix:device_removal",
>           "com.delphix:embedded_data",
> +        "com.delphix:empty_bpobj",
> +        "com.delphix:enable_txg",
>           "com.delphix:extensible_dataset",
>           "com.delphix:head_errlog",
>           "com.delphix:hole_birth",
> +        "com.delphix:livelist",
> +        "com.delphix:log_spacemap",
>           "com.delphix:obsolete_counts",
>           "com.delphix:spacemap_histogram",
>           "com.delphix:spacemap_v2",
>           "com.delphix:zpool_checkpoint",
>           "com.intel:allocation_classes",
> +        "com.joyent:filesystem_limits",
>           "com.joyent:multi_vdev_crash_dump",
> +        "com.openzfs:zilsaxattr",
> +        "com.zfsonlinux:project_quota",
> +        "com.zfsonlinux:userobj_accounting",
>           "org.freebsd:zstd_compress",
>           "org.illumos:lz4_compress",
>           "org.illumos:sha512",
>           "org.illumos:skein",
>           "org.open-zfs:large_blocks",
>           "org.openzfs:blake3",
> +        "org.openzfs:device_rebuild",
>           "org.zfsonlinux:allocation_classes",
>           "org.zfsonlinux:large_dnode",
>           NULL
> ---snip---
>
> Anyone able to test some of those or confirms my understanding is
> correct and would sign-off on a "reviewed by" level?
>

I'm inclined to strongly NAK this patch, absent some way to test it.
There's no issues today with any of them being absent causing
problems on boot that have been reported. The ZFS that's in the
boot loader is a reduced copy of what's in base and not everything is
supported. There's no urgency here to rush into this. The ones that
are on the list already are for things that we know we support in the
boot loader because we've gone to the trouble to put blake3 or sha512
into it (note: Not all boot loaders will support all ZFS features in the
future... x86 BIOS booting likely is going to have to be frozen at its
current ZFS feature set due to code size issues).

While most of these options look OK on the surface, I'd feel a lot better
if there were tests for these to prove they work. I'd also feel better if
the ZFS experts could explain how those come to be set on a zpool
as well. I'd settle for a good script that could be run as root (better
would be not as root) that would take a filesystem that was created
by makefs -t zfs and turn on these features after an zpool upgrade.
I have the vague outlines of a test suite for the boot loader that I
could see about integrating something like that into, but most of my
time these days is chasing after 'the last bug' in some kboot stuff I'm
working on (which includes issues with our ZFS in the boot loader
integration).

So not a hard no, but I plea for additional scripts to create images
that can be tested.

Warner


> Bye,
> Alexander.
> --
> http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF
> http://www.FreeBSD.org    netchild@FreeBSD.org  : PGP 0x8F31830F9F2772BF
>

--000000000000e37acf05ed0bacb8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, Nov 9, 2022 at 5:46 AM Alexan=
der Leidinger &lt;<a href=3D"mailto:Alexander@leidinger.net">Alexander@leid=
inger.net</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">Quoting Alexander Leidinger &lt;<a href=3D"mailto:Alexander@leid=
inger.net" target=3D"_blank">Alexander@leidinger.net</a>&gt; (from Tue, 08=
=C2=A0 <br>
Nov 2022 10:50:53 +0100):<br>
<br>
&gt; Quoting Warner Losh &lt;<a href=3D"mailto:imp@bsdimp.com" target=3D"_b=
lank">imp@bsdimp.com</a>&gt; (from Mon, 7 Nov 2022 14:23:11 -0700):<br>
&gt;<br>
&gt;&gt; =C2=A0<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0On Mon, Nov 7, 2022 at 4:15 AM Alexander=
 Leidinger=C2=A0 <br>
&gt;&gt; &lt;<a href=3D"mailto:Alexander@leidinger.net" target=3D"_blank">A=
lexander@leidinger.net</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Quoting Li-Wen Hsu &lt;<a href=3D"mailto:lwhsu@freebsd.org" ta=
rget=3D"_blank">lwhsu@freebsd.org</a>&gt; (from Mon, 7 Nov 2022 03:39:19 GM=
T):<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The branch main has been updated by lwhsu:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; URL:=C2=A0<br>
&gt;&gt;&gt;&gt; <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D72a1c=
b05cd230ce0d12a7180ae65ddbba2e0cb6d" rel=3D"noreferrer" target=3D"_blank">h=
ttps://cgit.FreeBSD.org/src/commit/?id=3D72a1cb05cd230ce0d12a7180ae65ddbba2=
e0cb6d</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; commit 72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d<br>
&gt;&gt;&gt;&gt; Author:=C2=A0 =C2=A0 =C2=A0Li-Wen Hsu &lt;lwhsu@FreeBSD.or=
g&gt;<br>
&gt;&gt;&gt;&gt; AuthorDate: 2022-11-07 03:30:09 +0000<br>
&gt;&gt;&gt;&gt; Commit:=C2=A0 =C2=A0 =C2=A0Li-Wen Hsu &lt;lwhsu@FreeBSD.or=
g&gt;<br>
&gt;&gt;&gt;&gt; CommitDate: 2022-11-07 03:30:09 +0000<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; =C2=A0 =C2=A0 =C2=A0rc(8): Add a zpoolupgrade rc.d script<=
br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; =C2=A0 =C2=A0 =C2=A0If a zpool is created by makefs(8), it=
s version is 5000, i.e., all<br>
&gt;&gt;&gt;&gt; =C2=A0 =C2=A0 =C2=A0feature flags are off.=C2=A0 Introduce=
 an rc script to run `zpool upgrade`<br>
&gt;&gt;&gt;&gt; =C2=A0 =C2=A0 =C2=A0over the assigned zpools on the first =
boot.=C2=A0 This is useful to the<br>
&gt;&gt;&gt;&gt; =C2=A0 =C2=A0 =C2=A0ZFS based VM images built from release=
(7).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.=
conf.5<br>
&gt;&gt;&gt;&gt; index f9ceabc83120..43fa44a5f1cb 100644<br>
&gt;&gt;&gt;&gt; --- a/share/man/man5/rc.conf.5<br>
&gt;&gt;&gt;&gt; +++ b/share/man/man5/rc.conf.5<br>
&gt;&gt;&gt;&gt; @@ -24,7 +24,7 @@<br>
&gt;&gt;&gt;&gt; =C2=A0 .\&quot;<br>
&gt;&gt;&gt;&gt; =C2=A0 .\&quot; $FreeBSD$<br>
&gt;&gt;&gt;&gt; =C2=A0 .\&quot;<br>
&gt;&gt;&gt;&gt; -.Dd August 28, 2022<br>
&gt;&gt;&gt;&gt; +.Dd November 7, 2022<br>
&gt;&gt;&gt;&gt; =C2=A0 .Dt RC.CONF 5<br>
&gt;&gt;&gt;&gt; =C2=A0 .Os<br>
&gt;&gt;&gt;&gt; =C2=A0 .Sh NAME<br>
&gt;&gt;&gt;&gt; @@ -2109,6 +2109,13 @@ A space-separated list of ZFS pool =
names for=C2=A0<br>
&gt;&gt;&gt;&gt; which new pool GUIDs should be<br>
&gt;&gt;&gt;&gt; =C2=A0 assigned upon first boot.<br>
&gt;&gt;&gt;&gt; =C2=A0 This is useful when using a ZFS pool copied from a =
template, such=C2=A0<br>
&gt;&gt;&gt;&gt; as a virtual<br>
&gt;&gt;&gt;&gt; =C2=A0 machine image.<br>
&gt;&gt;&gt;&gt; +.It Va zpool_upgrade<br>
&gt;&gt;&gt;&gt; +.Pq Vt str<br>
&gt;&gt;&gt;&gt; +A space-separated list of ZFS pool names for which versio=
n should=C2=A0<br>
&gt;&gt;&gt;&gt; be upgraded<br>
&gt;&gt;&gt;&gt; +upon first boot.<br>
&gt;&gt;&gt;&gt; +This is useful when using a ZFS pool generated by<br>
&gt;&gt;&gt;&gt; +.Xr makefs 8<br>
&gt;&gt;&gt;&gt; +utility.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; For someone who knows ZFS well, it is clear that only a zpool =
upgrade=C2=A0<br>
&gt;&gt;&gt; is done. Not so experienced people may assume there is a combi=
nation=C2=A0<br>
&gt;&gt;&gt; of zpool upgrade and zfs upgrade (more so for people which do =
not know=C2=A0<br>
&gt;&gt;&gt; what the difference is). Maybe you want to add some explicit=
=C2=A0<br>
&gt;&gt;&gt; documentation, that zfs upgrade + feature flags needs to be do=
ne by=C2=A0<br>
&gt;&gt;&gt; hand.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; And this brings me to a second topic, we don&#39;t have an exp=
licit list=C2=A0<br>
&gt;&gt;&gt; of features which are supported by the bootloader (I had a loo=
k at the=C2=A0<br>
&gt;&gt;&gt; zfs and the boot related man pages, if I overlooked a place, t=
hen the=C2=A0<br>
&gt;&gt;&gt; other places should reference this important part with some te=
xt).<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;&gt;=C2=A0 =C2=A0 There is a fixed list of features we support in the b=
oot loader:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;&gt;=C2=A0 =C2=A0 /*<br>
&gt;&gt; =C2=A0* List of ZFS features supported for read<br>
&gt;&gt; =C2=A0*/<br>
&gt;&gt; static const char *features_for_read[] =3D {<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:lz4_compress&quot;,<=
br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:hole_birth&quot;,<br=
>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:extensible_dataset&q=
uot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:embedded_data&quot;,=
<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.open-zfs:large_blocks&quot;,=
<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:sha512&quot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:skein&quot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:large_dnode&quot;=
,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.joyent:multi_vdev_crash_dump=
&quot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:spacemap_histogram&q=
uot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:zpool_checkpoint&quo=
t;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:spacemap_v2&quot;,<b=
r>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:encryption&quot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:bookmark_v2&quot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:allocation_classe=
s&quot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:resilver_defer&quot;,<=
br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:device_removal&quot;=
,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:obsolete_counts&quot=
;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.intel:allocation_classes&quo=
t;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.freebsd:zstd_compress&quot;,=
<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:bookmark_written&quo=
t;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:head_errlog&quot;,<b=
r>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.openzfs:blake3&quot;,<br>
&gt;&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL<br>
&gt;&gt; };<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;&gt;=C2=A0 =C2=A0 Any feature not on this list will cause the boot load=
er to=C2=A0 <br>
&gt;&gt; reject the pool.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;&gt;=C2=A0 =C2=A0 Whether or not it should do that by default, always, =
or never is an open<br>
&gt;&gt;=C2=A0 =C2=A0 question. I&#39;ve thought there should be a &#39;sho=
ot footing&#39;=C2=A0 <br>
&gt;&gt; override that isn&#39;t<br>
&gt;&gt;=C2=A0 =C2=A0 there today.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;<br>
&gt; Thanks for the list. For those interested, it is in<br>
&gt; =C2=A0 =C2=A0=C2=A0$SRC/stand/libsa/zfs/zfsimpl.c<br>
&gt;<br>
&gt; Just to make my opinion expressed before explicit again, this should=
=C2=A0 <br>
&gt; be documented in a boot / bootloader related man-page, but isn&#39;t.<=
br>
&gt;<br>
&gt; Should the above list be sorted in some way? Maybe in the same order=
=C2=A0 <br>
&gt; as the zpool-features lists them (sort by feature name after the=C2=A0=
 <br>
&gt; colon), or alphabetical?<br>
<br>
Is it OK if I commit this alphabetical sorting?<br>
---snip---<br>
diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c<br>
index 6b961f3110a..36c90613e82 100644<br>
--- a/stand/libsa/zfs/zfsimpl.c<br>
+++ b/stand/libsa/zfs/zfsimpl.c<br>
@@ -118,29 +118,29 @@ static vdev_list_t zfs_vdevs;<br>
=C2=A0 =C2=A0* List of ZFS features supported for read<br>
=C2=A0 =C2=A0*/<br>
=C2=A0 static const char *features_for_read[] =3D {<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:lz4_compress&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:hole_birth&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:extensible_dataset&quot;,<br=
>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:embedded_data&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.open-zfs:large_blocks&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:sha512&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:skein&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:large_dnode&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.joyent:multi_vdev_crash_dump&quot;,<=
br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:spacemap_histogram&quot;,<br=
>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:zpool_checkpoint&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:spacemap_v2&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:encryption&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:bookmark_v2&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:allocation_classes&quot;,=
<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:encryption&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:resilver_defer&quot;,<br=
>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:bookmark_written&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:device_removal&quot;,<=
br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:embedded_data&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:extensible_dataset&quot;,<br=
>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:head_errlog&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:hole_birth&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:obsolete_counts&quot;,=
<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:spacemap_histogram&quot;,<br=
>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:spacemap_v2&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:zpool_checkpoint&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.intel:allocation_classes&quot;=
,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.joyent:multi_vdev_crash_dump&quot;,<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.freebsd:zstd_compress&quot;,<b=
r>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:bookmark_written&quot;,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:head_errlog&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:lz4_compress&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:sha512&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:skein&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.open-zfs:large_blocks&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.openzfs:blake3&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:allocation_classes&quot;,=
<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:large_dnode&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL<br>
=C2=A0 };<br>
---snip---<br></blockquote><div><br></div><div>This patch looks good becaus=
e it&#39;s a nop and just tidies things up a bit.</div><div><br></div><div>=
Reviewed by: imp</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">
&gt; As Mark already mentioned some flags, I checked the features marked=C2=
=A0 <br>
&gt; as read only (I checked in the zpool-features man page, including=C2=
=A0 <br>
&gt; the dependencies documented there) and here are those not listed in=C2=
=A0 <br>
&gt; zfsimpl.c. I would assume as they are read-only compatible, we=C2=A0 <=
br>
&gt; should add them:<br>
&gt; =C2=A0 =C2=A0 com.delphix:async_destroy<br>
&gt; =C2=A0 =C2=A0 com.delphix:bookmarks<br>
&gt; =C2=A0 =C2=A0 org.openzfs:device_rebuild<br>
&gt; =C2=A0 =C2=A0 com.delphix:empty_bpobj<br>
&gt; =C2=A0 =C2=A0 com.delphix:enable_txg<br>
&gt; =C2=A0 =C2=A0 com.joyent:filesystem_limits<br>
&gt; =C2=A0 =C2=A0 com.delphix:livelist<br>
&gt; =C2=A0 =C2=A0 com.delphix:log_spacemap<br>
&gt; =C2=A0 =C2=A0 com.zfsonlinux:project_quota<br>
&gt; =C2=A0 =C2=A0 com.zfsonlinux:userobj_accounting<br>
&gt; =C2=A0 =C2=A0 com.openzfs:zilsaxattr<br>
<br>
If my understanding is correct that the read-only compatible parts=C2=A0 <b=
r>
(according to the zpool-features man page) are safe to add to the zfs=C2=A0=
 <br>
boot, here is what I have only build-tested (relative to the above=C2=A0 <b=
r>
alphabetical sorting):<br>
---snip---<br>
--- zfsimpl.c_sorted=C2=A0 =C2=A0 =C2=A0 =C2=A0 2022-11-09 12:55:06.3460830=
00 +0100<br>
+++ zfsimpl.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 2022-11-09 13:01:24.083364000 +010=
0<br>
@@ -121,24 +121,35 @@<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:bookmark_v2&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:encryption&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.datto:resilver_defer&quot;,<br=
>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:async_destroy&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:bookmark_written&quot;=
,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:bookmarks&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:device_removal&quot;,<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:embedded_data&quot;,<b=
r>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:empty_bpobj&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:enable_txg&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:extensible_dataset&quo=
t;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:head_errlog&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:hole_birth&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:livelist&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:log_spacemap&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:obsolete_counts&quot;,=
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:spacemap_histogram&quo=
t;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:spacemap_v2&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.delphix:zpool_checkpoint&quot;=
,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.intel:allocation_classes&quot;=
,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.joyent:filesystem_limits&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.joyent:multi_vdev_crash_dump&q=
uot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.openzfs:zilsaxattr&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.zfsonlinux:project_quota&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;com.zfsonlinux:userobj_accounting&quot;,=
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.freebsd:zstd_compress&quot;,<b=
r>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:lz4_compress&quot;,<br=
>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:sha512&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.illumos:skein&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.open-zfs:large_blocks&quot;,<b=
r>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.openzfs:blake3&quot;,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.openzfs:device_rebuild&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:allocation_classes&=
quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;org.zfsonlinux:large_dnode&quot;,<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL<br>
---snip---<br>
<br>
Anyone able to test some of those or confirms my understanding is=C2=A0 <br=
>
correct and would sign-off on a &quot;reviewed by&quot; level?<br></blockqu=
ote><div><br></div><div>I&#39;m inclined to strongly NAK this patch, absent=
 some way to test it.</div><div>There&#39;s no issues today with any of the=
m being absent causing</div><div>problems on boot that have been reported. =
The ZFS that&#39;s in the</div><div>boot loader is a reduced copy of what&#=
39;s in base and not everything is</div><div>supported. There&#39;s no urge=
ncy here to rush into this. The ones that</div><div>are on the list already=
 are for things that we know we support in the</div><div>boot loader becaus=
e we&#39;ve gone to the trouble to put blake3 or sha512</div><div>into it (=
note: Not all boot loaders will support all ZFS features in the</div><div>f=
uture... x86 BIOS booting likely is going to have to be frozen at its</div>=
<div>current ZFS feature set due to code size issues).</div><div><br></div>=
<div>While most of these options look OK on the surface, I&#39;d feel a lot=
 better</div><div>if there were tests for these to prove they work. I&#39;d=
 also feel better if</div><div>the ZFS experts could explain how those come=
 to be set on a zpool</div><div>as well. I&#39;d settle for a good script t=
hat could be run as root (better</div><div>would be not as root) that would=
 take a filesystem that was created</div><div>by makefs -t zfs and turn on =
these features after an zpool upgrade.</div><div>I have the vague outlines =
of a test suite for the boot loader that I</div><div>could see about integr=
ating something like that into, but most of my</div><div>time these days is=
 chasing after &#39;the last bug&#39; in some kboot stuff I&#39;m</div><div=
>working on (which includes issues with our ZFS in the boot loader</div><di=
v>integration).</div><div><br></div><div>So not a hard no, but I plea for a=
dditional scripts to create images</div><div>that can be tested.</div><div>=
<br></div><div>Warner</div><div>=C2=A0</div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex">
Bye,<br>
Alexander.<br>
-- <br>
<a href=3D"http://www.Leidinger.net" rel=3D"noreferrer" target=3D"_blank">h=
ttp://www.Leidinger.net</a> Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF=
<br>
<a href=3D"http://www.FreeBSD.org" rel=3D"noreferrer" target=3D"_blank">htt=
p://www.FreeBSD.org</a>=C2=A0 =C2=A0 netchild@FreeBSD.org=C2=A0 : PGP 0x8F3=
1830F9F2772BF<br>
</blockquote></div></div>

--000000000000e37acf05ed0bacb8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfptmipq%2BsS0AQ1%2B7EmLT-7YdKv8s%2BnCV7ON1Qy6-C6N9A>