summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2023-10-25 16:01:59 +0200
committerChristian Brauner <brauner@kernel.org>2023-11-18 14:56:16 +0100
commit98d2b43081972abeb5bb5a087bc3e3197531c46e (patch)
treeb56d8e448127d642c39b6fad6f14a5166666d3f1 /include/uapi
parentb85ea95d086471afb4ad062012a4d73cd328fa86 (diff)
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>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/stat.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h
index 7cab2c65d3d7..2f2ee82d5517 100644
--- a/include/uapi/linux/stat.h
+++ b/include/uapi/linux/stat.h
@@ -154,6 +154,7 @@ struct statx {
#define STATX_BTIME 0x00000800U /* Want/got stx_btime */
#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */
#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */
+#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */