2023-04-04 11:38:27

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 0/2 v2 RESEND] nfs-utils: Improving NFS re-export wrt. crossmnt

[Resending this series because I got to git add two header files.]

After a longer hiatus I'm sending the next iteration of my re-export
improvement patch series. While the kernel side is upstream since v6.2,
the nfs-utils parts are still missing.
This patch series aims to solve this.

The core idea is adding new export option, reeport=
Using reexport= it is possible to mark an export entry in the exports
file explicitly as NFS re-export and select a strategy on how unique
identifiers should be provided. This makes the crossmnt feature work
in the re-export case.
Currently two strategies are supported, "auto-fsidnum" and
"predefined-fsidnum".

In my earlier series a sqlite database was mandatory to keep track of
generated fsids.
This series follows a different approach, instead of directly using
sqlite in all nfs-utils components (linking libsqlite), a new deamon
manages the database, fsidd.
fsidd offers a simple (but stupid?) text based interface over a unix domain
socket which can be queried by mountd, exportfs, etc. for fsidnums.
The main idea behind fsidd is allowing users to implement their own
fsidd which keeps global state across load balancers.
I'm still not happy with fsidd, there is room for improvement but first
I'd like to know whether you like or hate this approach.

A typical export entry on a re-exporting server looks like:
/nfs *(rw,no_root_squash,no_subtree_check,crossmnt,reexport=auto-fsidnum)
reexport=auto-fsidnum will automatically assign an fsid= to /nfs and all
uncovered subvolumes.

Changes since v1, https://lore.kernel.org/linux-nfs/[email protected]/
- Factor out Sqlite and put it into a daemon
- Add fsidd
- Basically re-implemented the patch series
- Lot's of fixes (e.g. nfs v4 root export)


Richard Weinberger (2):
export: Add reexport= option
Implement fsidd

configure.ac | 1 +
support/Makefile.am | 2 +-
support/export/Makefile.am | 2 +
support/export/cache.c | 74 ++++++-
support/export/export.c | 27 ++-
support/include/nfslib.h | 1 +
support/nfs/Makefile.am | 1 +
support/nfs/exports.c | 62 ++++++
support/reexport/Makefile.am | 18 ++
support/reexport/backend_sqlite.c | 267 +++++++++++++++++++++++
support/reexport/fsidd.c | 198 +++++++++++++++++
support/reexport/reexport.c | 327 ++++++++++++++++++++++++++++
support/reexport/reexport.h | 18 ++
support/reexport/reexport_backend.h | 47 ++++
systemd/Makefile.am | 2 +
systemd/fsidd.service | 9 +
utils/exportd/Makefile.am | 6 +-
utils/exportd/exportd.c | 5 +
utils/exportfs/Makefile.am | 3 +
utils/exportfs/exportfs.c | 11 +
utils/exportfs/exports.man | 31 +++
utils/mount/Makefile.am | 3 +-
utils/mountd/Makefile.am | 2 +
23 files changed, 1106 insertions(+), 11 deletions(-)
create mode 100644 support/reexport/Makefile.am
create mode 100644 support/reexport/backend_sqlite.c
create mode 100644 support/reexport/fsidd.c
create mode 100644 support/reexport/reexport.c
create mode 100644 support/reexport/reexport.h
create mode 100644 support/reexport/reexport_backend.h
create mode 100644 systemd/fsidd.service

--
2.31.1


2023-04-15 18:17:05

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH 0/2 v2 RESEND] nfs-utils: Improving NFS re-export wrt. crossmnt



On 4/4/23 7:13 AM, Richard Weinberger wrote:
> [Resending this series because I got to git add two header files.]
My apologies for taking so long to get to this!
And Thank you for this work... But there is a
few issues ;-)
>
> After a longer hiatus I'm sending the next iteration of my re-export
> improvement patch series. While the kernel side is upstream since v6.2,
> the nfs-utils parts are still missing.
> This patch series aims to solve this.
>
> The core idea is adding new export option, reeport=
> Using reexport= it is possible to mark an export entry in the exports
> file explicitly as NFS re-export and select a strategy on how unique
> identifiers should be provided. This makes the crossmnt feature work
> in the re-export case.
> Currently two strategies are supported, "auto-fsidnum" and
> "predefined-fsidnum".
>
> In my earlier series a sqlite database was mandatory to keep track of
> generated fsids.
> This series follows a different approach, instead of directly using
> sqlite in all nfs-utils components (linking libsqlite), a new deamon
> manages the database, fsidd.
> fsidd offers a simple (but stupid?) text based interface over a unix domain
> socket which can be queried by mountd, exportfs, etc. for fsidnums.
> The main idea behind fsidd is allowing users to implement their own
> fsidd which keeps global state across load balancers.
> I'm still not happy with fsidd, there is room for improvement but first
> I'd like to know whether you like or hate this approach.
>
> A typical export entry on a re-exporting server looks like:
> /nfs *(rw,no_root_squash,no_subtree_check,crossmnt,reexport=auto-fsidnum)
> reexport=auto-fsidnum will automatically assign an fsid= to /nfs and all
> uncovered subvolumes.
>
> Changes since v1, https://lore.kernel.org/linux-nfs/[email protected]/
> - Factor out Sqlite and put it into a daemon
> - Add fsidd
> - Basically re-implemented the patch series
> - Lot's of fixes (e.g. nfs v4 root export)
>
>
> Richard Weinberger (2):
> export: Add reexport= option
> Implement fsidd
>
> configure.ac | 1 +
> support/Makefile.am | 2 +-
> support/export/Makefile.am | 2 +
> support/export/cache.c | 74 ++++++-
> support/export/export.c | 27 ++-
> support/include/nfslib.h | 1 +
> support/nfs/Makefile.am | 1 +
> support/nfs/exports.c | 62 ++++++
> support/reexport/Makefile.am | 18 ++
> support/reexport/backend_sqlite.c | 267 +++++++++++++++++++++++
> support/reexport/fsidd.c | 198 +++++++++++++++++
> support/reexport/reexport.c | 327 ++++++++++++++++++++++++++++
> support/reexport/reexport.h | 18 ++
> support/reexport/reexport_backend.h | 47 ++++
> systemd/Makefile.am | 2 +
> systemd/fsidd.service | 9 +
> utils/exportd/Makefile.am | 6 +-
> utils/exportd/exportd.c | 5 +
> utils/exportfs/Makefile.am | 3 +
> utils/exportfs/exportfs.c | 11 +
> utils/exportfs/exports.man | 31 +++
> utils/mount/Makefile.am | 3 +-
> utils/mountd/Makefile.am | 2 +
> 23 files changed, 1106 insertions(+), 11 deletions(-)
> create mode 100644 support/reexport/Makefile.am
> create mode 100644 support/reexport/backend_sqlite.c
> create mode 100644 support/reexport/fsidd.c
> create mode 100644 support/reexport/reexport.c
> create mode 100644 support/reexport/reexport.h
> create mode 100644 support/reexport/reexport_backend.h
> create mode 100644 systemd/fsidd.service
>
These patch does not apply cleanly on Chuck's TLS patches,
not something you could have voided and the fix
is minor... But!

Then the first patch does not compile without
the second patch due to a missing header file.

When the second patch is applied the compile
breaks in exportd code:
make[2]: *** No rule to make target
'../support/reexport/libreexport.a', needed by 'exportd'. Stop.

The first patch is way to big for debugging and reading... IMO.

Maybe the exportd, exportfs, and mount changes be put
in their own patches and maybe the reexport command
can be separated out from the rest of support/ changes
although that might be more difficult.

Not clear how you can break up the second patch other
than moving reexport_backend.h into the first patch
so it compiles...

I just committed Chuck's TLS patch (tag: nfs-utils-2-6-3-rc8)
So if you could rebase your patches to the head of my repo
that would great, with the above changes.

I'll be very motivate get these changes in for the
upcoming virtual bakeathon starting a week from
Monday (Apr 24). The detail are here [1]...

I'm hopeful you will be attending and setting a server
for us to test against.

Thanks again for all this work!!

steved.

[1] http://www.nfsv4bat.org/Events/2023/Apr/BAT/index.html

2023-04-18 12:52:12

by Richard Weinberger

[permalink] [raw]
Subject: Re: [PATCH 0/2 v2 RESEND] nfs-utils: Improving NFS re-export wrt. crossmnt

----- Ursprüngliche Mail -----
> Von: "Steve Dickson" <[email protected]>
> My apologies for taking so long to get to this!

No problem. :-)

> These patch does not apply cleanly on Chuck's TLS patches,
> not something you could have voided and the fix
> is minor... But!
>
> Then the first patch does not compile without
> the second patch due to a missing header file.
>
> When the second patch is applied the compile
> breaks in exportd code:
> make[2]: *** No rule to make target
> '../support/reexport/libreexport.a', needed by 'exportd'. Stop.
>
> The first patch is way to big for debugging and reading... IMO.
>
> Maybe the exportd, exportfs, and mount changes be put
> in their own patches and maybe the reexport command
> can be separated out from the rest of support/ changes
> although that might be more difficult.
>
> Not clear how you can break up the second patch other
> than moving reexport_backend.h into the first patch
> so it compiles...
>
> I just committed Chuck's TLS patch (tag: nfs-utils-2-6-3-rc8)
> So if you could rebase your patches to the head of my repo
> that would great, with the above changes.

I just rebased the whole series and spitted into multiple patches.
Every single patch builds now, sorry for that.

> I'll be very motivate get these changes in for the
> upcoming virtual bakeathon starting a week from
> Monday (Apr 24). The detail are here [1]...
>
> I'm hopeful you will be attending and setting a server
> for us to test against.

I'll try hard to attend! :-)

Thanks,
//richard