Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Nov 2023 14:30:09 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Rick Macklem <rick.macklem@gmail.com>
Cc:        Martin Matuska <mm@freebsd.org>, Alexander Motin <mav@freebsd.org>,  FreeBSD CURRENT <freebsd-current@freebsd.org>, Garrett Wollman <wollman@bimajority.org>,  Mike Karels <mike@karels.net>
Subject:   Re: RFC: #f FreeBSD_version of #ifdef <feature> for OpenZFS pull request
Message-ID:  <CANCZdfpevtaY_tGbCdHyRgb5GfYthvqAoy2QO5ySfdX2_3JHrg@mail.gmail.com>
In-Reply-To: <CAM5tNy7rJfEzMBoHe6UGLAZfpgpE-0KMsRjOkJhg1UaiAWt_vw@mail.gmail.com>
References:  <CAM5tNy7rJfEzMBoHe6UGLAZfpgpE-0KMsRjOkJhg1UaiAWt_vw@mail.gmail.com>

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

On Wed, Nov 22, 2023, 1:24 PM Rick Macklem <rick.macklem@gmail.com> wrote:

> Hi,
>
> I have a patch currently under review at D42672 that fixes visibility
> of snapshots under .zfs/snapshot for NFS clients.
> It adds a new function called vfs_exjail_clone(), which the ZFS
> code needs to use to fill in the mnt_exjail field.
>
> Since the OpenZFS code is supposed to build for 12.2 or later,
> I can see two ways of doing this:
> (A) #if on the FreeBSD_versions, which will look something like:
>
> #if (__FreeBSD_version >= 1300xxx && __FreeBSD_version < 1400000) ||
>      (__FreeBSD_version >= 1400yyy && __FreeBSD_version < 1400500) ||
>      (__FreeBSD_version >= 1400zzz && __FreeBSD_version < 1500000) ||
>      __FreeBSD_version >= 1500wwww
>          vfs_exjail_clone();
> #endif
>
> The problem with this one is I do not know what www, xxx, yyy and zzz are
> until I have MFC'd the patch and bumped __FreeBSD_version.
> --> I cannot generate the OpenZFS pull request until after that and,
>      since I am headed to Florida for a few weeks, it would be late
> December
>      at the earliest.
> OR
> (B) add a line like
> #define VFS_SUPPORTS_EXJAIL_CLONE    1
> to mount.h in the patch and then:
>
> #ifdef VFS_SUPPORTS_EXJAIL_CLONE
>          vfs_exjail_clone();
> #endif
>
> The adavntage of (B) is that I can do the pull request on OpenZFS
> right away and commit the patch to main, etc as soon as possible,
>
> So, which do you think is preferred? rick
> ps: Unless D42672 gets reviewed soon, it won't really matter w.r.t. timing.
>

I'd do B if I were doing this. With a comment for why I'm doing this
define. Then version numbers don't matter unless we botch something badly
and need them as a fallback.

Warner

--000000000000248665060ac46d3e
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 Wed, Nov 22, 2023, 1:24 PM Rick Macklem &lt;<a href=
=3D"mailto:rick.macklem@gmail.com">rick.macklem@gmail.com</a>&gt; wrote:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-=
left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have a patch currently under review at D42672 that fixes visibility<br>
of snapshots under .zfs/snapshot for NFS clients.<br>
It adds a new function called vfs_exjail_clone(), which the ZFS<br>
code needs to use to fill in the mnt_exjail field.<br>
<br>
Since the OpenZFS code is supposed to build for 12.2 or later,<br>
I can see two ways of doing this:<br>
(A) #if on the FreeBSD_versions, which will look something like:<br>
<br>
#if (__FreeBSD_version &gt;=3D 1300xxx &amp;&amp; __FreeBSD_version &lt; 14=
00000) ||<br>
=C2=A0 =C2=A0 =C2=A0(__FreeBSD_version &gt;=3D 1400yyy &amp;&amp; __FreeBSD=
_version &lt; 1400500) ||<br>
=C2=A0 =C2=A0 =C2=A0(__FreeBSD_version &gt;=3D 1400zzz &amp;&amp; __FreeBSD=
_version &lt; 1500000) ||<br>
=C2=A0 =C2=A0 =C2=A0__FreeBSD_version &gt;=3D 1500wwww<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vfs_exjail_clone();<br>
#endif<br>
<br>
The problem with this one is I do not know what www, xxx, yyy and zzz are<b=
r>
until I have MFC&#39;d the patch and bumped __FreeBSD_version.<br>
--&gt; I cannot generate the OpenZFS pull request until after that and,<br>
=C2=A0 =C2=A0 =C2=A0since I am headed to Florida for a few weeks, it would =
be late December<br>
=C2=A0 =C2=A0 =C2=A0at the earliest.<br>
OR<br>
(B) add a line like<br>
#define VFS_SUPPORTS_EXJAIL_CLONE=C2=A0 =C2=A0 1<br>
to mount.h in the patch and then:<br>
<br>
#ifdef VFS_SUPPORTS_EXJAIL_CLONE<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vfs_exjail_clone();<br>
#endif<br>
<br>
The adavntage of (B) is that I can do the pull request on OpenZFS<br>
right away and commit the patch to main, etc as soon as possible,<br>
<br>
So, which do you think is preferred? rick<br>
ps: Unless D42672 gets reviewed soon, it won&#39;t really matter w.r.t. tim=
ing.<br></blockquote></div></div><div dir=3D"auto"><br></div><div dir=3D"au=
to">I&#39;d do B if I were doing this. With a comment for why I&#39;m doing=
 this define. Then version numbers don&#39;t matter unless we botch somethi=
ng badly and need them as a fallback.</div><div dir=3D"auto"><br></div><div=
 dir=3D"auto">Warner</div><div dir=3D"auto"><br></div><div dir=3D"auto"><di=
v class=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>

--000000000000248665060ac46d3e--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpevtaY_tGbCdHyRgb5GfYthvqAoy2QO5ySfdX2_3JHrg>