Skip to content

Commit a206246

Browse files
committed
fs: ensure that internal tmpfs mount gets mount id zero
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". Link: https://patch.msgid.link/20260112-work-immutable-rootfs-v2-1-88dd1c34a204@kernel.org Fixes: 7f9bfaf ("fs: use xarray for old mount id") Reviewed-by: Jeff Layton <jlayton@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 8f0b4cc commit a206246

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static int mnt_alloc_id(struct mount *mnt)
221221
int res;
222222

223223
xa_lock(&mnt_id_xa);
224-
res = __xa_alloc(&mnt_id_xa, &mnt->mnt_id, mnt, XA_LIMIT(1, INT_MAX), GFP_KERNEL);
224+
res = __xa_alloc(&mnt_id_xa, &mnt->mnt_id, mnt, xa_limit_31b, GFP_KERNEL);
225225
if (!res)
226226
mnt->mnt_id_unique = ++mnt_id_ctr;
227227
xa_unlock(&mnt_id_xa);

0 commit comments

Comments
 (0)