From nobody Mon Nov 07 21:23:11 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N5kjm6vFMz4gQlx for ; Mon, 7 Nov 2022 21:23:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N5kjm5Yv5z5L5r for ; Mon, 7 Nov 2022 21:23:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ed1-x533.google.com with SMTP id a5so19607628edb.11 for ; Mon, 07 Nov 2022 13:23:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=waRya1N2tQe0JnFq/ZDoqZpsWUb63aCjP4Xq5zzbe/g=; b=vtSuKuPE16mRp5quJaWj+L7f+v7Tu1zxDbi0nmBz+aEYFne9gsvY7T7P+TONqsn+wb mVr4fS8ZEzQXxHq9EV6/AlZaEt8M10zNtltbZmYYaQiHjJA3cg/Qap75UzDllX+YAfUB wLZtc1NMmRkrHb1BDh4Mx79H5tOePFwaXGRRewKlY37YHSrhTtjzLO+6gruqdmgqlVcg gZNKig5HDgEupnn0BUdag1qWVwRJtAIakEZsOIYe0CLz9IsiQSlp6ByC7osaHB4WM1em reBV2I4Fa/uLZFMJNOv+krKxlMUf+xFgx+aRnnH498cQ9Gc7Hu5Q2ho7UigQJAgP1eOe z3nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=waRya1N2tQe0JnFq/ZDoqZpsWUb63aCjP4Xq5zzbe/g=; b=QWq1vDw+2FTxvSHOLr9EW2LH18reafEelMM3JZ/tLpnNDZfvNR389Qv1orC9sOZdf9 YsphOhOQRBQg6ld53Ifzsp7pObNUwQz3px4G8KucCpgYYLKWzxXHQ1RuJxHWS50lpGz1 DEAt+k+2wfNkmjdAKWOcuJpZHUD9Ps1QU5V3QmFmlLsP39uAQ1ZdA4S9iLtQbeY0+dUS mb29ABx4VYwJFu+pZBBpZ44UBY5uwiOQV/mRV2wCHu7HW6L/4ItEGm14w/V/Wuq/N60P yZNjx+pbtR4xjYtzXXqJZlyU0BI8VAgz/g7c2Zi0TXQylNwm1+AE1pxmc1cmjZUSbL9+ 1H8g== X-Gm-Message-State: ACrzQf1T1BGpXXWgc9DjJOR2p5kR0ELN6rtw3rfQyc/WQowmyg1Ts3GN KT8Gx5sTWFhDPrESxtshs2zvT9Oqd8ami0SWr//6Dg== X-Google-Smtp-Source: AMsMyM4+9C+MS+FTxwMcmsRtn681AjJBMTobomw1E4U9zrp+MRXdPReu59Td2oNXyivdiwykevUayyzyxUognUHjA4A= X-Received: by 2002:a05:6402:94e:b0:463:525e:8738 with SMTP id h14-20020a056402094e00b00463525e8738mr44641079edz.154.1667856202824; Mon, 07 Nov 2022 13:23:22 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202211070339.2A73dJlO027991@gitrepo.freebsd.org> <20221107121514.Horde.nulS9Wg1s3yzAsXXkuJRBa9@webmail.leidinger.net> In-Reply-To: <20221107121514.Horde.nulS9Wg1s3yzAsXXkuJRBa9@webmail.leidinger.net> From: Warner Losh Date: Mon, 7 Nov 2022 14:23:11 -0700 Message-ID: Subject: Re: git: 72a1cb05cd23 - main - rc(8): Add a zpoolupgrade rc.d script To: Alexander Leidinger Cc: Li-Wen Hsu , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000818e1905ece808da" X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Rspamd-Queue-Id: 4N5kjm5Yv5z5L5r X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000818e1905ece808da Content-Type: text/plain; charset="UTF-8" On Mon, Nov 7, 2022 at 4:15 AM Alexander Leidinger wrote: > > Quoting Li-Wen Hsu (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 > > AuthorDate: 2022-11-07 03:30:09 +0000 > > Commit: Li-Wen Hsu > > 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. Warner --000000000000818e1905ece808da Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Nov 7, 2022 at 4:15 AM Alexan= der Leidinger <Alexander@leid= inger.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:=C2=A0
> https://cgit.= FreeBSD.org/src/commit/?id=3D72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d >
> commit 72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d
> Author:=C2=A0 =C2=A0 =C2=A0Li-Wen Hsu <lwhsu@FreeBSD.org>
> AuthorDate: 2022-11-07 03:30:09 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Li-Wen Hsu <lwhsu@FreeBSD.org>
> CommitDate: 2022-11-07 03:30:09 +0000
>
>=C2=A0 =C2=A0 =C2=A0rc(8): Add a zpoolupgrade rc.d script
>
>=C2=A0 =C2=A0 =C2=A0If a zpool is created by makefs(8), its version is = 5000, i.e., all
>=C2=A0 =C2=A0 =C2=A0feature flags are off.=C2=A0 Introduce an rc script= to run `zpool upgrade`
>=C2=A0 =C2=A0 =C2=A0over the assigned zpools on the first boot.=C2=A0 T= his is useful to the
>=C2=A0 =C2=A0 =C2=A0ZFS 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 @@
>=C2=A0 .\"
>=C2=A0 .\" $FreeBSD$
>=C2=A0 .\"
> -.Dd August 28, 2022
> +.Dd November 7, 2022
>=C2=A0 .Dt RC.CONF 5
>=C2=A0 .Os
>=C2=A0 .Sh NAME
> @@ -2109,6 +2109,13 @@ A space-separated list of ZFS pool names for=C2= =A0
> which new pool GUIDs should be
>=C2=A0 assigned upon first boot.
>=C2=A0 This is useful when using a ZFS pool copied from a template, suc= h=C2=A0
> as a virtual
>=C2=A0 machine image.
> +.It Va zpool_upgrade
> +.Pq Vt str
> +A space-separated list of ZFS pool names for which version should=C2= =A0
> 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=C2=A0=
is done. Not so experienced people may assume there is a combination=C2=A0 =
of zpool upgrade and zfs upgrade (more so for people which do not know=C2= =A0
what the difference is). Maybe you want to add some explicit=C2=A0
documentation, that zfs upgrade + feature flags needs to be done by=C2=A0 <= br> hand.

And this brings me to a second topic, we don't have an explicit list=C2= =A0
of features which are supported by the bootloader (I had a look at the=C2= =A0
zfs and the boot related man pages, if I overlooked a place, then the=C2=A0=
other places should reference this important part with some text).

There is a fixed list of features we support in= the boot loader:

/*
=C2=A0* List of ZFS featur= es supported for read
=C2=A0*/
static const char *features_for_read[]= =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.illumos:lz4_compress",=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:hole_birth",
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:extensible_dataset",
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:embedded_data",
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 "org.open-zfs:large_blocks",
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 "org.illumos:sha512",
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 "org.illumos:skein",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "= org.zfsonlinux:large_dnode",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.= joyent:multi_vdev_crash_dump",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "co= m.delphix:spacemap_histogram",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "co= m.delphix:zpool_checkpoint",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.= delphix:spacemap_v2",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.datto:e= ncryption",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.datto:bookmark_v2= ",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.zfsonlinux:allocation_clas= ses",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.datto:resilver_defer&qu= ot;,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:device_removal",=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:obsolete_counts",=C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.intel:allocation_classes",
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.freebsd:zstd_compress",
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:bookmark_written",
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:head_errlog",
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 "org.openzfs:blake3",
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 NULL
};

Any feature not on this list= will cause the boot loader to reject the pool.

Wh= ether 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.

War= ner=C2=A0
--000000000000818e1905ece808da--