git: 861abdadf9db - main - namei: Add a comment explaining ISRESTARTED flag

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Tue, 13 Jun 2023 12:24:37 UTC
The branch main has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=861abdadf9db4dd7ba577537ba262fcda29869dd

commit 861abdadf9db4dd7ba577537ba262fcda29869dd
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-06-13 12:22:09 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-06-13 12:22:09 +0000

    namei: Add a comment explaining ISRESTARTED flag
    
    Reviewed by:            kib
    Differential Revision:  https://reviews.freebsd.org/D40494
---
 sys/kern/vfs_lookup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index c813296b4931..20919fb38b4d 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -81,6 +81,11 @@ static void NDVALIDATE_impl(struct nameidata *, int);
 #define NDVALIDATE(ndp)
 #endif
 
+/*
+ * Prepare namei() to restart. Reset components to its original state and set
+ * ISRESTARTED flag which signals the underlying lookup code to change the root
+ * from ABI root to actual root and prevents a further restarts.
+ */
 #define	NDRESTART(ndp) do {						\
 	NDREINIT_DBG(ndp);						\
 	ndp->ni_resflags = 0;						\