public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: Benjamin Coddington <bcodding@hammerspace.com>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
	Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	Eric Biggers <ebiggers@kernel.org>,
	Rick Macklem <rick.macklem@gmail.com>,
	linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH v1 1/4] nfsd: Convert export flags to use BIT() macro
Date: Fri, 16 Jan 2026 10:38:56 -0500	[thread overview]
Message-ID: <d548815e-bab2-4f1a-8c41-003aaf4f7c14@kernel.org> (raw)
In-Reply-To: <8F2645AA-9CB4-44D5-9121-8699216EF7CD@hammerspace.com>

On 1/16/26 10:35 AM, Benjamin Coddington wrote:
> On 16 Jan 2026, at 10:31, Chuck Lever wrote:
> 
>> On Fri, Jan 16, 2026, at 9:32 AM, Benjamin Coddington wrote:
>>> Simplify these defines for consistency, readability, and clarity.
>>>
>>> Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
>>> ---
>>>  fs/nfsd/nfsctl.c                 |  2 +-
>>>  include/uapi/linux/nfsd/export.h | 38 ++++++++++++++++----------------
>>>  2 files changed, 20 insertions(+), 20 deletions(-)
>>>
>>> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
>>> index 30caefb2522f..8ccc65bb09fd 100644
>>> --- a/fs/nfsd/nfsctl.c
>>> +++ b/fs/nfsd/nfsctl.c
>>> @@ -169,7 +169,7 @@ static const struct file_operations
>>> exports_nfsd_operations = {
>>>
>>>  static int export_features_show(struct seq_file *m, void *v)
>>>  {
>>> -	seq_printf(m, "0x%x 0x%x\n", NFSEXP_ALLFLAGS, NFSEXP_SECINFO_FLAGS);
>>> +	seq_printf(m, "0x%lx 0x%lx\n", NFSEXP_ALLFLAGS, NFSEXP_SECINFO_FLAGS);
>>>  	return 0;
>>>  }
>>>
>>> diff --git a/include/uapi/linux/nfsd/export.h
>>> b/include/uapi/linux/nfsd/export.h
>>> index a73ca3703abb..4e712bb02322 100644
>>> --- a/include/uapi/linux/nfsd/export.h
>>> +++ b/include/uapi/linux/nfsd/export.h
>>> @@ -26,22 +26,22 @@
>>>   * Please update the expflags[] array in fs/nfsd/export.c when adding
>>>   * a new flag.
>>>   */
>>> -#define NFSEXP_READONLY		0x0001
>>> -#define NFSEXP_INSECURE_PORT	0x0002
>>> -#define NFSEXP_ROOTSQUASH	0x0004
>>> -#define NFSEXP_ALLSQUASH	0x0008
>>> -#define NFSEXP_ASYNC		0x0010
>>> -#define NFSEXP_GATHERED_WRITES	0x0020
>>> -#define NFSEXP_NOREADDIRPLUS    0x0040
>>> -#define NFSEXP_SECURITY_LABEL	0x0080
>>> -/* 0x100 currently unused */
>>> -#define NFSEXP_NOHIDE		0x0200
>>> -#define NFSEXP_NOSUBTREECHECK	0x0400
>>> -#define	NFSEXP_NOAUTHNLM	0x0800		/* Don't authenticate NLM requests -
>>> just trust */
>>> -#define NFSEXP_MSNFS		0x1000	/* do silly things that MS clients
>>> expect; no longer supported */
>>> -#define NFSEXP_FSID		0x2000
>>> -#define	NFSEXP_CROSSMOUNT	0x4000
>>> -#define	NFSEXP_NOACL		0x8000	/* reserved for possible ACL related use
>>> */
>>> +#define NFSEXP_READONLY			BIT(0)
>>> +#define NFSEXP_INSECURE_PORT	BIT(1)
>>> +#define NFSEXP_ROOTSQUASH		BIT(2)
>>> +#define NFSEXP_ALLSQUASH		BIT(3)
>>> +#define NFSEXP_ASYNC			BIT(4)
>>> +#define NFSEXP_GATHERED_WRITES	BIT(5)
>>> +#define NFSEXP_NOREADDIRPLUS    BIT(6)
>>> +#define NFSEXP_SECURITY_LABEL	BIT(7)
>>> +/* BIT(8) currently unused */
>>> +#define NFSEXP_NOHIDE			BIT(9)
>>> +#define NFSEXP_NOSUBTREECHECK	BIT(10)
>>> +#define NFSEXP_NOAUTHNLM		BIT(11)	/* Don't authenticate NLM requests -
>>> just trust */
>>> +#define NFSEXP_MSNFS			BIT(12)	/* do silly things that MS clients
>>> expect; no longer supported */
>>> +#define NFSEXP_FSID				BIT(13)
>>> +#define NFSEXP_CROSSMOUNT		BIT(14)
>>> +#define NFSEXP_NOACL			BIT(15)	/* reserved for possible ACL related
>>> use */
>>>  /*
>>>   * The NFSEXP_V4ROOT flag causes the kernel to give access only to
>>> NFSv4
>>>   * clients, and only to the single directory that is the root of the
>>> @@ -51,11 +51,11 @@
>>>   * pseudofilesystem, which provides access only to paths leading to
>>> each
>>>   * exported filesystem.
>>>   */
>>> -#define	NFSEXP_V4ROOT		0x10000
>>> -#define NFSEXP_PNFS		0x20000
>>> +#define NFSEXP_V4ROOT			BIT(16)
>>> +#define NFSEXP_PNFS				BIT(17)
>>>
>>>  /* All flags that we claim to support.  (Note we don't support NOACL.) */
>>> -#define NFSEXP_ALLFLAGS		0x3FEFF
>>> +#define NFSEXP_ALLFLAGS			BIT(18) - BIT(8) - 1
>>>
>>>  /* The flags that may vary depending on security flavor: */
>>>  #define NFSEXP_SECINFO_FLAGS	(NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
>>> -- 
>>> 2.50.1
>>
>> This might constitute a breaking user space API change. BIT() is
>> a kernel convention. What defines BIT() for user space consumers
>> of this header?
> 
> Doh - good catch.  I can drop this, or maybe add:
> 
> #ifndef BIT
> #define BIT(n) (1UL << (n))
> #endif
I'm happy leaving these as hex constants.


-- 
Chuck Lever

  reply	other threads:[~2026-01-16 15:39 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 14:32 [PATCH v1 0/4] kNFSD Signed Filehandles Benjamin Coddington
2026-01-16 14:32 ` [PATCH v1 1/4] nfsd: Convert export flags to use BIT() macro Benjamin Coddington
2026-01-16 15:31   ` Chuck Lever
2026-01-16 15:35     ` Benjamin Coddington
2026-01-16 15:38       ` Chuck Lever [this message]
2026-01-16 15:39         ` Benjamin Coddington
2026-01-16 14:32 ` [PATCH v1 2/4] nfsd: Add a key for signing filehandles Benjamin Coddington
2026-01-16 14:59   ` Jeff Layton
2026-01-16 15:09     ` Chuck Lever
2026-01-16 15:18       ` Benjamin Coddington
2026-01-16 15:25       ` Jeff Layton
2026-01-16 15:45         ` Chuck Lever
2026-01-16 15:52           ` Jeff Layton
2026-01-16 16:17             ` Chuck Lever
2026-01-19 16:15     ` Benjamin Coddington
2026-01-16 16:11   ` Chuck Lever
2026-01-16 16:42     ` Benjamin Coddington
2026-01-16 19:55       ` Chuck Lever
2026-01-16 21:37   ` kernel test robot
2026-01-16 14:32 ` [PATCH v1 3/4] NFSD/export: Add sign_fh export option Benjamin Coddington
2026-01-16 16:26   ` Chuck Lever
2026-01-16 14:32 ` [PATCH v1 4/4] NFSD: Sign filehandles Benjamin Coddington
2026-01-16 17:12   ` Chuck Lever
2026-01-16 18:29     ` Benjamin Coddington
2026-01-16 22:47   ` kernel test robot
2026-01-16 16:56 ` [PATCH v1 0/4] kNFSD Signed Filehandles Chuck Lever
2026-01-16 17:17   ` Benjamin Coddington
2026-01-16 19:43     ` Chuck Lever
2026-01-16 20:03       ` Trond Myklebust
2026-01-16 20:11       ` Benjamin Coddington
2026-01-17  0:54 ` [PATCH v1 4/4] NFSD: Sign filehandles NeilBrown
2026-01-17 12:30   ` Benjamin Coddington
2026-01-17  1:24 ` [PATCH v1 0/4] kNFSD Signed Filehandles NeilBrown
2026-01-17 12:30   ` Benjamin Coddington
2026-01-19  4:24     ` NeilBrown
2026-01-19  9:14 ` Christian Brauner
2026-01-19 21:06   ` NeilBrown
2026-01-19 21:29     ` Jeff Layton
2026-01-19 22:58       ` NeilBrown
2026-01-20  9:23     ` Christian Brauner
2026-01-20  9:46       ` NeilBrown
2026-01-20 10:20         ` Christian Brauner
2026-01-20 10:28           ` NeilBrown
2026-01-20 10:37             ` Christian Brauner
2026-01-20 10:13 ` NeilBrown
2026-01-20 12:56   ` Benjamin Coddington
2026-01-20 10:55 ` Miklos Szeredi
2026-01-20 13:03   ` Benjamin Coddington
2026-01-20 14:44     ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d548815e-bab2-4f1a-8c41-003aaf4f7c14@kernel.org \
    --to=cel@kernel.org \
    --cc=anna@kernel.org \
    --cc=bcodding@hammerspace.com \
    --cc=chuck.lever@oracle.com \
    --cc=ebiggers@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=rick.macklem@gmail.com \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox