From nobody Wed Nov 22 21:30:09 2023 X-Original-To: freebsd-current@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 4SbDtT736Hz522vB for ; Wed, 22 Nov 2023 21:30:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 4SbDtS4MJWz4d4Z for ; Wed, 22 Nov 2023 21:30:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=YvpNOiOr; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::535) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-54a95657df3so369704a12.0 for ; Wed, 22 Nov 2023 13:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1700688621; x=1701293421; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xuPyxY3okCjv/Yyh9bKcbV2sxeLoQk7DHp+GdNFF7uM=; b=YvpNOiOr88lX6t7j5PIplmyu4e6GNTQ9fSrzdGdI1BgJH1Bh+usQ50+T3bdazth6WJ iYLODRjYUz8n37H2t+U9dNtk6j7t6mgt99dc0p9480ATnrEOAVsju+/K1gBR4x4unmQz ljQHANBqXIlPPj2/qnksuwzyKwW401QUkeaBBmvXh3xNZNqG6iK6GPEIWj8uGCnnQyOg TYuGO1v0mXD43nUVTqqNlZKGIQAgxflFihx9Huh4B7FQ4anyHyhF8QA3o7+pYwD1BAJh eTQ1inErjJy60dwWi8CUdVg6pv1q09rRt8NV6F0bbypnRbqjo7fb57tXads7JoJV5+4O YBug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700688621; x=1701293421; 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=xuPyxY3okCjv/Yyh9bKcbV2sxeLoQk7DHp+GdNFF7uM=; b=o6hPKo6qsVHFRPne3YGnrC5y0LFtWvQQ4JD8ZemTn71dvvXI5BW6j7InwM4geaSN8v qeJ6K2WyZNKp+RU0mxCa/z4i7o4uTfsfF4dqSsZwwTSWG8D2h8ySINxq0G36BKQuZvDK kv3zvVHELLZ2WYAEH+WSvXgk282l8am1Aw98htMw2oK+UwNDpVbIoQfpbAA4HBWMBXvo 8yC3cLSsPEfxTmRiAWKdlCd8tPGTdOZWSF95Isozf9N5vQBnFencx0UnSHwP3Ef7AZIz djWDDE0m6OH3WhHQWlX9Y7LSSd1HqvqPMRYscbvwdbeFvCIcTh7hnOuLOjeXSYeFKfnI RqgQ== X-Gm-Message-State: AOJu0YyS6G4qqwejRjwavDmGXjeGdxeKztkwRV3TpKpfRIGPAfm/k4IY wmgbP61/fNVMUw3lAWmnWsEP517w3C6fLEidvh6aZw== X-Google-Smtp-Source: AGHT+IEzmX2MSwKPPV2LKNvJxp3HeV3wLsHPl/y8FKXUkkx6RrYBt3xyRdAAONl83Ab/a9aapmslz3q2p3y84GqbItU= X-Received: by 2002:aa7:c1cf:0:b0:53d:b751:ece1 with SMTP id d15-20020aa7c1cf000000b0053db751ece1mr2523960edp.41.1700688621237; Wed, 22 Nov 2023 13:30:21 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Wed, 22 Nov 2023 14:30:09 -0700 Message-ID: Subject: Re: RFC: #f FreeBSD_version of #ifdef for OpenZFS pull request To: Rick Macklem Cc: Martin Matuska , Alexander Motin , FreeBSD CURRENT , Garrett Wollman , Mike Karels Content-Type: multipart/alternative; boundary="000000000000248665060ac46d3e" X-Spamd-Result: default: False [-1.12 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.62)[-0.615]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::535:from]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; TAGGED_RCPT(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[no SPF record] X-Rspamd-Queue-Id: 4SbDtS4MJWz4d4Z X-Spamd-Bar: - --000000000000248665060ac46d3e Content-Type: text/plain; charset="UTF-8" On Wed, Nov 22, 2023, 1:24 PM Rick Macklem 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


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 >=3D 1300xxx && __FreeBSD_version < 14= 00000) ||
=C2=A0 =C2=A0 =C2=A0(__FreeBSD_version >=3D 1400yyy && __FreeBSD= _version < 1400500) ||
=C2=A0 =C2=A0 =C2=A0(__FreeBSD_version >=3D 1400zzz && __FreeBSD= _version < 1500000) ||
=C2=A0 =C2=A0 =C2=A0__FreeBSD_version >=3D 1500wwww
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vfs_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,
=C2=A0 =C2=A0 =C2=A0since I am headed to Florida for a few weeks, it would = be late December
=C2=A0 =C2=A0 =C2=A0at the earliest.
OR
(B) add a line like
#define VFS_SUPPORTS_EXJAIL_CLONE=C2=A0 =C2=A0 1
to mount.h in the patch and then:

#ifdef VFS_SUPPORTS_EXJAIL_CLONE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vfs_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. tim= ing.

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 somethi= ng badly and need them as a fallback.

Warner

--000000000000248665060ac46d3e--