Page MenuHomeFreeBSD

Allow setting NFS server scope and owner.

Authored by mav on Sep 13 2021, 8:05 PM.



By default NFS server reports as scope and owner major the host UUID value and zero for owner minor. It works good in case of standalone server. But in case of CARP-based HA cluster failover the values should remain persistent, otherwise some clients like VMware ESXi get confused by the change and fail to reconnect automatically.

The patch makes server scope, major owner and minor owner values configurable via sysctls. If not set (by default) the host UUID value is used.

Diff Detail

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mav requested review of this revision.Sep 13 2021, 8:05 PM
mav created this revision.

Looks fine to me. I'm not sure if it is worth worrying about,
but if someone were to set the sysctls when the server is
running, it could cause trouble.

If you think that this is worth worrying about, I think you could
define a "sysctl_XXX(SYSCTL_HANDLER_ARGS)" function
that return EINVAL if (newnfs_numnfsd > 0).

I do think having the three sysctls makes sense, just in
case there is a future case where one needs to be set and
the other can use hostuuid.


Looks fine. You could drop the "(void)" in front of
nfsm_strtom(). That was a habit I picked up decades ago,
when gcc cared.

This revision is now accepted and ready to land.Sep 14 2021, 3:07 PM
This revision was automatically updated to reflect the committed changes.