[RFC PATCH 1/3] fs: Add documentation to some `struct fs_struct` fields

From: John Ericson

Date: Mon Jun 29 2026 - 03:06:45 EST


From: John Ericson <mail@xxxxxxxxxxxxxx>

This will be expanded upon in the next commit.

Link: https://lore.kernel.org/all/a49ce818-f38d-41b0-bbf7-80b8aad998b1@xxxxxxxxxxxxxxxx/
Signed-off-by: John Ericson <mail@xxxxxxxxxxxxxx>
---
include/linux/fs_struct.h | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 0070764b790a..b5db5de9eb01 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -12,7 +12,21 @@ struct fs_struct {
seqlock_t seq;
int umask;
int in_exec;
- struct path root, pwd;
+
+ /*
+ * The root directory for the task(s) that points to this
+ * `fs_struct`. The root directory also controls how `..`
+ * resolve; path traversal is not allowed to resolve upwards
+ * beyond the root directory. (It is for this latter reason that
+ * `chroot` is a privileged operation.)
+ */
+ struct path root;
+
+ /*
+ * The current working directory for the task(s) that points to
+ * this `fs_struct`.
+ */
+ struct path pwd;
} __randomize_layout;

extern struct kmem_cache *fs_cachep;
--
2.51.2