TL;DR:
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.
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.
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.
* 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.
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 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.
Thanks...
peace & happiness,
martin