LK_RETRY set in cn_lkflags for VOP_LOOKUP?

From: Rick Macklem <rick.macklem_at_gmail.com>
Date: Mon, 21 Apr 2025 22:37:55 UTC
Hi,

I just spotted something in the NFS server that seems like
it is a bug, but I thought I'd check.
(Note that I have never seen this cause a problem, but I
think it might if a server file system is being forced
dismounted while the NFS server is accessing it.)

What I spotted was a few places where:
  cnp->cn_lkflags = LK_SHARED | LK_RETRY;
  ...
  error = VOP_LOOKUP(..);
I don't think LK_RETRY should be set here.
For example vget_finish() uses the flags argument
for a "error = vn_lock(..flags);", which would retry
instead of returning an error when the vnode is VI_DOOMED.

So, is this a bug that needs to be fixed?

Thanks, rick