]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
add unique mount ID
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 25 Oct 2023 14:01:59 +0000 (16:01 +0200)
committerChristian Brauner <brauner@kernel.org>
Sat, 18 Nov 2023 13:56:16 +0000 (14:56 +0100)
commit98d2b43081972abeb5bb5a087bc3e3197531c46e
treeb56d8e448127d642c39b6fad6f14a5166666d3f1
parentb85ea95d086471afb4ad062012a4d73cd328fa86
add unique mount ID

If a mount is released then its mnt_id can immediately be reused.  This is
bad news for user interfaces that want to uniquely identify a mount.

Implementing a unique mount ID is trivial (use a 64bit counter).
Unfortunately userspace assumes 32bit size and would overflow after the
counter reaches 2^32.

Introduce a new 64bit ID alongside the old one.  Initialize the counter to
2^32, this guarantees that the old and new IDs are never mixed up.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Link: https://lore.kernel.org/r/20231025140205.3586473-2-mszeredi@redhat.com
Reviewed-by: Ian Kent <raven@themaw.net>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/mount.h
fs/namespace.c
fs/stat.c
include/uapi/linux/stat.h