git: 22bb70a6b3bb - main - namei: add more detail about LOCKSHARED's behavior

From: Alan Somers <asomers_at_FreeBSD.org>
Date: Tue, 17 Dec 2024 21:06:12 UTC
The branch main has been updated by asomers:

URL: https://cgit.FreeBSD.org/src/commit/?id=22bb70a6b3bb7799276ab480e40665b7d6e4ce25

commit 22bb70a6b3bb7799276ab480e40665b7d6e4ce25
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2024-12-17 20:10:57 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2024-12-17 21:05:59 +0000

    namei: add more detail about LOCKSHARED's behavior
    
    [skip ci]
    
    MFC after:      2 weeks
    Sponsored by:   ConnectWise
    Reviewed by:    markj
    Differential Revision: https://reviews.freebsd.org/D48125
---
 share/man/man9/namei.9 | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/share/man/man9/namei.9 b/share/man/man9/namei.9
index 0be73f68cdda..63a6d3b11f6f 100644
--- a/share/man/man9/namei.9
+++ b/share/man/man9/namei.9
@@ -31,7 +31,7 @@
 .\" If you integrate this manpage in another OS, I'd appreciate a note
 .\"	- eivind@FreeBSD.org
 .\"
-.Dd July 8, 2023
+.Dd December 17, 2024
 .Dt NAMEI 9
 .Os
 .Sh NAME
@@ -124,7 +124,6 @@ Lock vnode on return with
 unless
 .Dv LOCKSHARED
 is also set.
-The
 .Xr VOP_UNLOCK 9
 should be used
 to release the lock (or
@@ -153,8 +152,20 @@ and
 .Xr vrele 9 .
 .It Dv LOCKSHARED
 Lock vnode on return with
-.Dv LK_SHARED .
-The
+.Dv LK_SHARED ,
+if permitted by the file system that owns the vnode.
+The file system must explicitly permit this by setting
+.Dv MNTK_LOOKUP_SHARED
+in
+.Dv mp->mnt_kern_flag
+during mount and by calling
+.Fn VN_LOCK_ASHARE
+when allocating the vnode.
+If
+.Dv LOCKLEAF
+is specified but shared locking is not permitted, then the vnode will be
+returned with
+.Dv LK_EXCLUSIVE .
 .Xr VOP_UNLOCK 9
 should be used
 to release the lock (or