From: John Ericson <John.Ericson@Obsidian.Systems>
To: "Andy Lutomirski" <luto@kernel.org>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Christian Brauner" <brauner@kernel.org>,
"Jan Kara" <jack@suse.cz>, "David Howells" <dhowells@redhat.com>,
"Chuck Lever" <cel@kernel.org>,
"Jeff Layton" <jlayton@kernel.org>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"David Laight" <david.laight.linux@gmail.com>,
"H. Peter Anvin" <hpa@zytor.com>, "Li Chen" <me@linux.beauty>,
"Cong Wang" <cwang@multikernel.io>,
"Arnd Bergmann" <arnd@arndb.de>,
"Thomas Gleixner" <tglx@kernel.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Borislav Petkov" <bp@alien8.de>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"Jonathan Corbet" <corbet@lwn.net>, "Kees Cook" <kees@kernel.org>,
"Sergei Zimmerman" <sergei@zimmerman.foo>,
"Farid Zakaria" <farid.m.zakaria@gmail.com>,
linux-arch <linux-arch@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-api <linux-api@vger.kernel.org>,
netfs <netfs@lists.linux.dev>,
linux-nfs <linux-nfs@vger.kernel.org>
Cc: John Ericson <mail@JohnEricson.me>
Subject: [RFC PATCH 1/3] fs: Add documentation to some `struct fs_struct` fields
Date: Mon, 29 Jun 2026 02:58:20 -0400 [thread overview]
Message-ID: <20260629065934.1425479-2-John.Ericson@Obsidian.Systems> (raw)
In-Reply-To: <20260629065934.1425479-1-John.Ericson@Obsidian.Systems>
From: John Ericson <mail@JohnEricson.me>
This will be expanded upon in the next commit.
Link: https://lore.kernel.org/all/a49ce818-f38d-41b0-bbf7-80b8aad998b1@app.fastmail.com/
Signed-off-by: John Ericson <mail@JohnEricson.me>
---
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
next prev parent reply other threads:[~2026-06-29 6:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 6:58 [RFC PATCH 0/3] fs: support tasks with a null root or cwd John Ericson
2026-06-29 6:58 ` John Ericson [this message]
2026-06-29 6:58 ` [RFC PATCH 2/3] " John Ericson
2026-06-29 9:19 ` Christian Brauner
2026-06-29 6:58 ` [RFC PATCH 3/3] fs: add KUnit tests for " John Ericson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260629065934.1425479-2-John.Ericson@Obsidian.Systems \
--to=john.ericson@obsidian.systems \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=brauner@kernel.org \
--cc=cel@kernel.org \
--cc=corbet@lwn.net \
--cc=cwang@multikernel.io \
--cc=dave.hansen@linux.intel.com \
--cc=david.laight.linux@gmail.com \
--cc=dhowells@redhat.com \
--cc=farid.m.zakaria@gmail.com \
--cc=hpa@zytor.com \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=kees@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mail@JohnEricson.me \
--cc=me@linux.beauty \
--cc=mingo@redhat.com \
--cc=netfs@lists.linux.dev \
--cc=sergei@zimmerman.foo \
--cc=skhan@linuxfoundation.org \
--cc=tglx@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox