FBSD: Handle F_UNLCK in VOP_ADVLOCK 79/12579/4
authorTim Creech <tcreech@tcreech.com>
Sun, 5 Mar 2017 23:17:23 +0000 (18:17 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 23 Aug 2019 02:54:49 +0000 (22:54 -0400)
commitf5acf1b1bfe940faf0a6f4bd11c55d6c90f60242
tree8d769a35828db0fa410d3c2daee003df8a512b28
parentee7019a7630d01f29fecebd89ca69ad8a37e24e2
FBSD: Handle F_UNLCK in VOP_ADVLOCK

When a_fl->type is F_UNLCK, FreeBSD gives our VOP_ADVLOCK an a_op of
F_UNLCK, instead of F_SETLK like we expect. This causes afs_lockctl to
return EINVAL, since F_UNLCK isn't a normal fcntl lock op, and so
userspace requests to unlock fcntl-style locks always fail. This can
be seen, for example, when trying to use sqlite3 to access a database
that lives in afs.

This F_UNLCK behavior in FreeBSD seems a bit peculiar, but has been
around effectively forever (since 4.4BSD-Lite). So just work around
it.

[adeason@dson.org: minor style adjustments and commit message/comment
rewording.]

Change-Id: I8bfaff9274e40761aa291930430a08b83b524d1b
Reviewed-on: https://gerrit.openafs.org/12579
Reviewed-by: Tim Creech <tcreech@tcreech.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/FBSD/osi_vnodeops.c