[PATCH v2 10/13] nfsd: add netlink upcall for the svc_export cache

Jeff Layton posted 13 patches 1 week, 1 day ago
Re: [PATCH v2 10/13] nfsd: add netlink upcall for the svc_export cache
Posted by Chuck Lever 3 days, 11 hours ago
On Wed, Mar 25, 2026, at 10:40 AM, Jeff Layton wrote:
> Add netlink-based cache upcall support for the svc_export (nfsd.export)
> cache to Documentation/netlink/specs/nfsd.yaml and regenerate the
> resulting files.

> diff --git a/Documentation/netlink/specs/nfsd.yaml 
> b/Documentation/netlink/specs/nfsd.yaml
> index 
> 8ab43c8253b2e83bcc178c3f4fe8c41c2997d153..709751502f8b56bd4b68462fa15337df5e3e035e 
> 100644
> --- a/Documentation/netlink/specs/nfsd.yaml
> +++ b/Documentation/netlink/specs/nfsd.yaml
> @@ -6,7 +6,51 @@ uapi-header: linux/nfsd_netlink.h
> 
>  doc: NFSD configuration over generic netlink.
> 
> +definitions:
> +  -
> +    type: flags
> +    name: cache-type
> +    entries: [svc_export]
> +  -
> +    type: flags
> +    name: export-flags
> +    doc: These flags are ordered to match the NFSEXP_* flags in 
> include/linux/nfsd/export.h
> +    entries:
> +      - readonly
> +      - insecure-port
> +      - rootsquash
> +      - allsquash
> +      - async
> +      - gathered-writes
> +      - noreaddirplus
> +      - security-label
> +      - sign-fh
> +      - nohide
> +      - nosubtreecheck
> +      - noauthnlm
> +      - msnfs
> +      - fsid
> +      - crossmount
> +      - noacl
> +      - v4root
> +      - pnfs
> +  -
> +    type: flags
> +    name: xprtsec-mode
> +    doc: These flags are ordered to match the NFSEXP_XPRTSEC_* flags 
> in include/linux/nfsd/export.h
> +    entries:
> +      - none
> +      - tls
> +      - mtls
> +
>  attribute-sets:
> +  -
> +    name: cache-notify
> +    attributes:
> +      -
> +        name: cache-type
> +        type: u32
> +        enum: cache-type
>    -
>      name: rpc-status
>      attributes:
> @@ -132,6 +176,103 @@ attribute-sets:
>        -
>          name: npools
>          type: u32
> +  -
> +    name: fslocation
> +    attributes:
> +      -
> +        name: host
> +        type: string
> +      -
> +        name: path
> +        type: string
> +  -
> +    name: fslocations
> +    attributes:
> +      -
> +        name: location
> +        type: nest
> +        nested-attributes: fslocation
> +        multi-attr: true
> +  -
> +    name: auth-flavor
> +    attributes:
> +      -
> +        name: pseudoflavor
> +        type: u32
> +      -
> +        name: flags
> +        type: u32
> +        enum: export-flags
> +        enum-as-flags: true
> +  -
> +    name: svc-export-req
> +    attributes:
> +      -
> +        name: seqno
> +        type: u64
> +      -
> +        name: client
> +        type: string
> +      -
> +        name: path
> +        type: string

Is the svc-export-req attribute set used for anything?


> +  -
> +    name: svc-export
> +    attributes:
> +      -
> +        name: seqno
> +        type: u64
> +      -
> +        name: client
> +        type: string
> +      -
> +        name: path
> +        type: string
> +      -
> +        name: negative
> +        type: flag
> +      -
> +        name: expiry
> +        type: u64
> +      -
> +        name: anon-uid
> +        type: u32
> +      -
> +        name: anon-gid
> +        type: u32
> +      -
> +        name: fslocations
> +        type: nest
> +        nested-attributes: fslocations
> +      -
> +        name: uuid
> +        type: binary
> +      -
> +        name: secinfo
> +        type: nest
> +        nested-attributes: auth-flavor
> +        multi-attr: true
> +      -
> +        name: xprtsec
> +        type: u32
> +        enum: xprtsec-mode
> +        multi-attr: true
> +      -
> +        name: flags
> +        type: u32
> +        enum: export-flags
> +        enum-as-flags: true
> +      -
> +        name: fsid
> +        type: s32
> +  -
> +    name: svc-export-reqs
> +    attributes:
> +      -
> +        name: requests
> +        type: nest
> +        nested-attributes: svc-export
> +        multi-attr: true
> 
>  operations:
>    list:
> @@ -233,3 +374,36 @@ operations:
>            attributes:
>              - mode
>              - npools
> +    -
> +      name: cache-notify
> +      doc: Notification that there are cache requests that need 
> servicing
> +      attribute-set: cache-notify
> +      mcgrp: exportd
> +      event:
> +        attributes:
> +          - cache-type
> +    -
> +      name: svc-export-get-reqs
> +      doc: Dump all pending svc_export requests
> +      attribute-set: svc-export-reqs
> +      flags: [admin-perm]
> +      dump:
> +          request:
> +            attributes:
> +              - requests
> +    -
> +      name: svc-export-set-reqs
> +      doc: Respond to one or more svc_export requests
> +      attribute-set: svc-export-reqs
> +      flags: [admin-perm]
> +      do:
> +          request:
> +            attributes:
> +              - requests
> +
> +mcast-groups:
> +  list:
> +    -
> +      name: none
> +    -
> +      name: exportd


-- 
Chuck Lever
Re: [PATCH v2 10/13] nfsd: add netlink upcall for the svc_export cache
Posted by Jeff Layton 3 days, 10 hours ago
On Mon, 2026-03-30 at 10:22 -0400, Chuck Lever wrote:
> > 
> > +  -
> > +    name: svc-export-req
> > +    attributes:
> > +      -
> > +        name: seqno
> > +        type: u64
> > +      -
> > +        name: client
> > +        type: string
> > +      -
> > +        name: path
> > +        type: string
> 
> Is the svc-export-req attribute set used for anything?
> 
> 

No, good catch.

That's a holdover from an earlier version that had a separate attribute
set for the up and downcalls. It's not needed in the latest version.

It should be fine to remove it and regenerate the headers. The result
builds fine without it. I've pushed a fixed patch to the 'exportd-nl'
branch in my tree. You can fix it up or I can resend if you prefer.

Thanks,
-- 
Jeff Layton <jlayton@kernel.org>
Re: [PATCH v2 10/13] nfsd: add netlink upcall for the svc_export cache
Posted by Chuck Lever 3 days, 10 hours ago

On Mon, Mar 30, 2026, at 10:49 AM, Jeff Layton wrote:
> On Mon, 2026-03-30 at 10:22 -0400, Chuck Lever wrote:
>> > 
>> > +  -
>> > +    name: svc-export-req
>> > +    attributes:
>> > +      -
>> > +        name: seqno
>> > +        type: u64
>> > +      -
>> > +        name: client
>> > +        type: string
>> > +      -
>> > +        name: path
>> > +        type: string
>> 
>> Is the svc-export-req attribute set used for anything?
>> 
>> 
>
> No, good catch.
>
> That's a holdover from an earlier version that had a separate attribute
> set for the up and downcalls. It's not needed in the latest version.
>
> It should be fine to remove it and regenerate the headers. The result
> builds fine without it. I've pushed a fixed patch to the 'exportd-nl'
> branch in my tree. You can fix it up or I can resend if you prefer.

Thanks for jumping on that. Let's wait to see if there are other review
comments.


-- 
Chuck Lever