Since this function ultimately calls vn_lock() or VOP_LOCK1(), allows it to
receive and pass this flag which is used in the lookup code and doesn't
interfere with the function's operation.
Details
- Reviewers
jah mjg kib markj - Commits
- rGf58378393fb0: vn_lock_pair(): Support passing LK_NODDLKTREAT
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
What are the useful flags for the ops? For instance, LK_SLEEPFAIL also makes no sense, as well as LK_TIMELOCK. In fact I do not see any useful flags for vn_lock_pair()
I have not analyzed all LK_ flags, and just excluded the most obvious ones.
My principal goal doing this is to be able to pass LK_NODDLKTREAT and use vn_lock_pair() in vfs_lookup() (to remove vp_crossmp; see next differential in the stack). You may think it doesn't make sense if you assume that no other vnode is locked than the two passed to the function, but ffs_lock() actually relies on the presence of LK_NODDLKTREAT to add LK_ADAPTIVE internally (the reason of which I don't know). As another example, LK_INTERLOCK would make sense as well, but supporting it requires (small) changes.
From a cursory look, I don't think any other flags would make sense indeed.
So what about just checking for LK_NODDLKTREAT explicitly and not allowing other flags? (And possibly add LK_INTERLOCK with the required support code.)
LK_NODDLKTREAT is not about other vnodes being locked, it has something to do with the priority of lock acquire (it was an old attempt to fix some LoRs with the vm_fault AFAIR).
Please do only enable the flag instead of allowing everything.