OpenAFS client patches for FreeBSD 11+

I’ve been slowly working on getting the OpenAFS client to build/work better on FreeBSD 11+. This started as a small collection of FreeBSD Ports tree patches for net/openafs, but grew into patches rebased on top of the upstream 1.6 and master branches.

In addition to bringing FreeBSD 11 support, the patches primarily rework the global lock implementation, which in turn allows avoiding/fixing several problematic data races.


I need to submit these to upstream AFS. Before the patches AFS doesn’t build on FreeBSD 11+, and it’s easy to cause a panic or hang with client activity. With these patches, the client can survive things like make -j9 buildworld with both the sources and work directory sitting in AFS.

However, some activities (think writing via mmap or locking) can still cause hangs. In particular, launching firefox in an AFS home directory results in fancy activity from sqlite and firefox will likely hang. Umount can hang as well, although the chance of this seems to be greatly reduced by doing a fs flushall immediately before the umount attempt. A workaround is to symlink ~/.mozilla and XDG_CACHE_HOME to point a local disk.

Ports tree patches for 1.6 (stable) and FreeBSD 10/11

See net/openafs in my fork of the FreeBSD ports tree.

Changes on upstream master

See the freebsd11 branch in my fork of the OpenAFS source tree.