From: Christian Brauner <brauner@kernel.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Alexander Viro" <viro@zeniv.linux.org.uk>,
"Jan Kara" <jack@suse.cz>, "Jeff Layton" <jlayton@kernel.org>,
"Amir Goldstein" <amir73il@gmail.com>,
"Lennart Poettering" <lennart@poettering.net>,
"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>,
"Josef Bacik" <josef@toxicpanda.com>,
"Christian Brauner" <brauner@kernel.org>,
stable@vger.kernel.org
Subject: [PATCH 1/3] fs: ensure that internal tmpfs mount gets mount id zero
Date: Fri, 02 Jan 2026 15:36:22 +0100 [thread overview]
Message-ID: <20260102-work-immutable-rootfs-v1-1-f2073b2d1602@kernel.org> (raw)
In-Reply-To: <20260102-work-immutable-rootfs-v1-0-f2073b2d1602@kernel.org>
and the rootfs get mount id one as it always has. Before we actually
mount the rootfs we create an internal tmpfs mount which has mount id
zero but is never exposed anywhere. Continue that "tradition".
Fixes: 7f9bfafc5f49 ("fs: use xarray for old mount id")
Cc: <stable@vger.kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index c58674a20cad..8b082b1de7f3 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -221,7 +221,7 @@ static int mnt_alloc_id(struct mount *mnt)
int res;
xa_lock(&mnt_id_xa);
- res = __xa_alloc(&mnt_id_xa, &mnt->mnt_id, mnt, XA_LIMIT(1, INT_MAX), GFP_KERNEL);
+ res = __xa_alloc(&mnt_id_xa, &mnt->mnt_id, mnt, xa_limit_31b, GFP_KERNEL);
if (!res)
mnt->mnt_id_unique = ++mnt_id_ctr;
xa_unlock(&mnt_id_xa);
--
2.47.3
next prev parent reply other threads:[~2026-01-02 14:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-02 14:36 [PATCH 0/3] fs: add immutable rootfs and support pivot_root() in the initramfs Christian Brauner
2026-01-02 14:36 ` Christian Brauner [this message]
2026-01-02 14:36 ` [PATCH 2/3] fs: add init_pivot_root() Christian Brauner
2026-01-02 14:36 ` [PATCH 3/3] fs: add immutable rootfs Christian Brauner
2026-01-04 7:27 ` Al Viro
2026-01-04 7:41 ` Al Viro
2026-01-06 22:07 ` Christian Brauner
2026-01-06 22:59 ` Al Viro
2026-01-07 10:53 ` Christian Brauner
2026-01-07 2:28 ` Gao Xiang
2026-01-07 2:47 ` Al Viro
2026-01-07 2:55 ` Gao Xiang
2026-01-07 10:52 ` Christian Brauner
2026-01-07 16:33 ` Colin Walters
2026-01-08 11:02 ` Christian Brauner
2026-01-25 20:47 ` Askar Safin
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=20260102-work-immutable-rootfs-v1-1-f2073b2d1602@kernel.org \
--to=brauner@kernel.org \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=josef@toxicpanda.com \
--cc=lennart@poettering.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zbyszek@in.waw.pl \
/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