I have implemented NFSv4 -> POSIX ACL mapping in FSAL_VFS. I
would like to
submit a simplified version that doesn't attempt to build on FreeBSD. That
would vastly simplify the code and reduce the amount of review required. It
would look something like this:
https://github.com/martin-schwenke/nfs-ganesha/commits/vfs-acls-no-
freebsd
Some of the "build" commits could be squashed together if desired.
That sounds like a reasonable way to proceed. Please do squash commits as appropriate.
TLDR: FreeBSD has never had long term committed support. We just barely have the resources
to maintain the stuff we use so adding FreeBSD maintenance would be too much. Please feel
free to not attempt to make FreeBSD work.
Details:
I have implemented NFSv4 -> POSIX ACL mapping in FSAL_VFS. Once I
understood what needed to be done, this was a fairly simple plumbing job...
apart from FreeBSD compatibility.
This is currently sitting in
https://github.com/martin-schwenke/nfs-ganesha/commits/vfs-acls
However, before putting it up for review, I have some questions, mostly about
FreeBSD support.
First, the ACL part of the discussion...
Although FreeBSD supports POSIX ACLs, I don't think anyone wants to use a
mapping to POSIX ACLs on FreeBSD. I think they would want to use FreeBSD's
NFSv4 ACLs on ZFS. That would mean including some entirely different hunks of
code in src/FSAL/FSAL_VFS/vfs/attrs.c, or perhaps even src/FSAL/FSAL_VFS/zfs/.
I think my attempts at fixing the FreeBSD build (see below) show that I'm not
qualified to attempt this. It should be done by an experienced FreeBSD
developer.
A "full" solution would be to support both paths... And yea, a zfs sub-FSAL
would be the way to handle the availability of NFSv4 native ACLs.
Now for the build problems...
While getting this to compile I found several places where NFS Ganesha
wouldn't compile on FreeBSD. Some of this might be because I was using the
default clang compiler, but switching to gcc made things fail in different places,
so I stuck with the default.
The simplest solution was this:
cmake -DUSE_9P=OFF -DUSE_NFS3=OFF \
-DUSE_FSAL_PROXY_V4=OFF -DUSE_FSAL_GPFS=OFF \
-DUSE_GSS=OFF \
../nfs-ganesha/src
Then I only needed a couple the first couple of fixes from:
https://github.com/martin-schwenke/nfs-ganesha/commits/freebsd-build-
fixes
* If I switch on 9p and NFS3 then I need the rest, but those "fixes"
become increasingly dodgy.
* It seems clear that the GPFS support should be more cooperative about
disabling itself without being forced off. I'll look into that some
other time.
Yea, that might be good.
* Building with GSS support has link-time problems resolving symbols
in
Kerberos libraries. My lack of understanding about FreeBSD's different
Kerberos versions and how to make them play nicely with cmake made me
shrug my shoulders and move on. This isn't fixed in the above branch.
* I'm happy to take advice on which of the above fixes I should submit
for upstream inclusion. The first 3 or 4 seem fairly obvious.
I suppose we could take a set of fixes for FreeBSD but I'm not sure how worthwhile
that is if we are not committing to full support. What might be an option is to push your
FreeBSD fixes branch into the nfs-ganesha Github repo so someone coming along later
wanting to make FreeBSD work again could look to those patches to jump start their
efforts.
In summary, the FreeBSD build seems quite broken. NFS Ganesha was
removed
from FreeBSD's ports and it seems that not many people care.
If there's no visible "champion" for FreeBSD, we should let it drift back
into bit rot.
If people agree then, to simplify the code, I can drop all of the
FreeBSD
compatibility and only enable the ACL mapping if Linux's acl/libacl.h is available.
Yes, please do so.
Thanks for this effort
Frank