Page MenuHomeFreeBSD

namei: Add a comment explaining ISRESTARTED flag
ClosedPublic

Authored by dchagin on Jun 12 2023, 8:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 13, 5:24 PM
Unknown Object (File)
Mon, Apr 13, 5:18 PM
Unknown Object (File)
Tue, Apr 7, 9:04 PM
Unknown Object (File)
Mon, Apr 6, 10:52 PM
Unknown Object (File)
Wed, Apr 1, 5:22 AM
Unknown Object (File)
Tue, Mar 31, 9:20 PM
Unknown Object (File)
Tue, Mar 31, 5:27 PM
Unknown Object (File)
Tue, Mar 31, 7:21 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 52002
Build 48893: arc lint + arc unit

Event Timeline

sys/kern/vfs_lookup.c
85

I think it should be mention what is restarted. You are switching from ABI root to the actual root.

Done, first version was:

+/*
+ * The ports infrastructure for the non-native (Linux) ABI installs it's
+ * files under the $LOCAL_BASE and the native ABI shares some common files
+ * with a non-native, ie, /etc/passwd. Therefore, a non-native ABI needs a
+ * special technics to dynamically reroot lookup operations.
+ * Dinamic reroot means restart namei, ie, at first, namei() lookups the
+ * file in /ABI root/original-path. If that fails, the lookup is done in
+ * /actual root/original-path.
+ * The namei() can be restarted only if a ABI specifies the ABI root via
+ * a call to pwd_altroot() during exec into that ABI.
+ *
+ * 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.
+ */

I thought it was too much))

This revision is now accepted and ready to land.Jun 12 2023, 11:11 PM