]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: use all available ids
authorChristian Brauner <brauner@kernel.org>
Fri, 19 Jul 2024 11:41:48 +0000 (13:41 +0200)
committerChristian Brauner <brauner@kernel.org>
Wed, 24 Jul 2024 08:53:13 +0000 (10:53 +0200)
The counter is unconditionally incremented for each mount allocation.
If we set it to 1ULL << 32 we're losing 4294967296 as the first valid
non-32 bit mount id.

Link: https://lore.kernel.org/r/20240719-work-mount-namespace-v1-1-834113cab0d2@kernel.org
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c

index 221db9de472967132a682097e213ebec642df486..328087a4df8a6e19f5a64cff8fe53423a04f6df9 100644 (file)
@@ -70,7 +70,7 @@ static DEFINE_IDA(mnt_id_ida);
 static DEFINE_IDA(mnt_group_ida);
 
 /* Don't allow confusion with old 32bit mount ID */
-#define MNT_UNIQUE_ID_OFFSET (1ULL << 32)
+#define MNT_UNIQUE_ID_OFFSET (1ULL << 31)
 static atomic64_t mnt_id_ctr = ATOMIC64_INIT(MNT_UNIQUE_ID_OFFSET);
 
 static struct hlist_head *mount_hashtable __ro_after_init;