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.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -154,6 +154,7 @@ struct statx { · 153 unmodified lines | |||
| 154 | #define STATX_BTIME 0x00000800U /* Want/got stx_btime */ | 154 | #define STATX_BTIME 0x00000800U /* Want/got stx_btime */ |
| 155 | #define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */ | 155 | #define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */ |
| 156 | #define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */ | 156 | #define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */ |
| 157 | #define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */ | ||
| 157 | 158 | ||
| 158 | #define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */ | 159 | #define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */ |
| 159 | 160 | ||