Date: Mon, 12 Feb 2024 19:28:10 -0700 From: Warner Losh <imp@bsdimp.com> To: Jessica Clarke <jrtc27@freebsd.org> Cc: Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org> Subject: Re: git: 0df5f65908dd - main - reboot: Implement zfs support Message-ID: <CANCZdfrdfN5xkPLR3BVhaw7%2BDOPeibwue%2BnA0sGq=JKMoVBrig@mail.gmail.com> In-Reply-To: <DA2564A0-1647-4610-B9EC-FDA8298755CA@freebsd.org> References: <202402121853.41CIrfdp030604@gitrepo.freebsd.org> <DA2564A0-1647-4610-B9EC-FDA8298755CA@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000e4a7c306113a2543 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 12, 2024, 6:10=E2=80=AFPM Jessica Clarke <jrtc27@freebsd.org> w= rote: > On 12 Feb 2024, at 18:53, Warner Losh <imp@FreeBSD.org> wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D0df5f65908dd1913212535e6c4dd4c7= 3ce19c305 > > > > commit 0df5f65908dd1913212535e6c4dd4c73ce19c305 > > Author: Warner Losh <imp@FreeBSD.org> > > AuthorDate: 2024-02-12 18:45:37 +0000 > > Commit: Warner Losh <imp@FreeBSD.org> > > CommitDate: 2024-02-12 18:45:37 +0000 > > > > reboot: Implement zfs support > > > > Implement full support for ZFS -k support. For ZFS, we have to set a > > property that gets cleared by the boot loaeder for whether or not to > > process nextboot.conf. Do this using system("zfsbootcfg..." rather > than > > coding the small subset of that program inline to avoid CDDL > > contamination of reboot and the complications of disabling CDDL and/= or > > ZFS. The few bytes needed to implement reboot for systems with zfs i= s > > not worth saving for systems w/o ZFS. > > Can we at least use posix_spawn rather than system? The asprintf+system > combo may in practice be safe, especially given the nature of this > tool, but I don=E2=80=99t think it=E2=80=99s a great idea to be writing s= ystem-using > code in 2024 when it=E2=80=99s easy to avoid. That way nobody needs to st= op and > think carefully about whether the code is safe, because it is by > construction. > News to me, but also the first time I've used system in 15 or 20 years... Sure, I'll rework and add you to the reviewers. So TIL... Warner > --000000000000e4a7c306113a2543 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" = class=3D"gmail_attr">On Mon, Feb 12, 2024, 6:10=E2=80=AFPM Jessica Clarke &= lt;<a href=3D"mailto:jrtc27@freebsd.org">jrtc27@freebsd.org</a>> wrote:<= br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde= r-left:1px #ccc solid;padding-left:1ex">On 12 Feb 2024, at 18:53, Warner Lo= sh <imp@FreeBSD.org> wrote:<br> > <br> > The branch main has been updated by imp:<br> > <br> > URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D0df5f65908dd= 1913212535e6c4dd4c73ce19c305" rel=3D"noreferrer noreferrer" target=3D"_blan= k">https://cgit.FreeBSD.org/src/commit/?id=3D0df5f65908dd1913212535e6c4dd4c= 73ce19c305</a><br> > <br> > commit 0df5f65908dd1913212535e6c4dd4c73ce19c305<br> > Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org><br> > AuthorDate: 2024-02-12 18:45:37 +0000<br> > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org><br> > CommitDate: 2024-02-12 18:45:37 +0000<br> > <br> >=C2=A0 =C2=A0 reboot: Implement zfs support<br> > <br> >=C2=A0 =C2=A0 Implement full support for ZFS -k support. For ZFS, we ha= ve to set a<br> >=C2=A0 =C2=A0 property that gets cleared by the boot loaeder for whethe= r or not to<br> >=C2=A0 =C2=A0 process nextboot.conf. Do this using system("zfsboot= cfg..." rather than<br> >=C2=A0 =C2=A0 coding the small subset of that program inline to avoid C= DDL<br> >=C2=A0 =C2=A0 contamination of reboot and the complications of disablin= g CDDL and/or<br> >=C2=A0 =C2=A0 ZFS. The few bytes needed to implement reboot for systems= with zfs is<br> >=C2=A0 =C2=A0 not worth saving for systems w/o ZFS.<br> <br> Can we at least use posix_spawn rather than system? The asprintf+system<br> combo may in practice be safe, especially given the nature of this<br> tool, but I don=E2=80=99t think it=E2=80=99s a great idea to be writing sys= tem-using<br> code in 2024 when it=E2=80=99s easy to avoid. That way nobody needs to stop= and<br> think carefully about whether the code is safe, because it is by<br> construction.<br></blockquote></div></div><div dir=3D"auto"><br></div><div = dir=3D"auto">News to me, but also the first time I've used system in 15= or 20 years...</div><div dir=3D"auto"><br></div><div dir=3D"auto">Sure, I&= #39;ll rework and add you to the reviewers. So TIL...</div><div dir=3D"auto= "><br></div><div dir=3D"auto">Warner=C2=A0</div><div dir=3D"auto"><div clas= s=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .= 8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote></div></div></div> --000000000000e4a7c306113a2543--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrdfN5xkPLR3BVhaw7%2BDOPeibwue%2BnA0sGq=JKMoVBrig>