FBSD: Remove LOCKPARENT/ISLASTCN lookup logic
Currently, our afs_vop_lookup on FBSD tries to only lock 'dvp' for
ISDOTDOT requests when LOCKPARENT and ISLASTCN are set. There are a
couple of problems with this:
- The conditional locking logic involving LOCKPARENT/ISLASTCN is only
relevant in very old FreeBSD releases (per-fs checking of these
flags for parent locking went away around the FreeBSD 6 era).
- Our current logic here is wrong anyway, since we try to lock 'dvp'
twice when those flags are set. This was mostly introduced by commit
2f6be821 (FBSD: band-aid vnode locking in lookup), which added a
lock/unlock pair for 'dvp' around the lock for 'vp', even though
'dvp' was unlocked several lines earlier.
This means that if we hit the relevant code path, we will deadlock,
since we try to lock 'dvp' twice. To avoid this, just remove the
relevant logic for LOCKPARENT/ISLASTCN, since it is only relevant for
old FreeBSD releases that are not supported by us or FreeBSD.
Add and rearrange some comments around here to try to more explicitly
explain the relevant locking rules.
[adeason@dson.org: Commit message rewrite, adding comments, removing
old FreeBSD code.]
Change-Id: Iaa2c55d82c50d5a8ab42c67b0996a2b4fb6e09e6
Reviewed-on: https://gerrit.openafs.org/12578
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>