]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
open_by_handle: verify u32 and u64 mount IDs
authorAleksa Sarai <cyphar@cyphar.com>
Wed, 4 Sep 2024 19:48:22 +0000 (05:48 +1000)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Sep 2024 05:19:28 +0000 (13:19 +0800)
commit1e207662b3ce3ed712a827f4fedc580d0dc8c02f
treede9c141d62530bed0a0808e49022836f21598c71
parent0afb586a7e7790b2ee3dbc4f4b4742c6f9305b48
open_by_handle: verify u32 and u64 mount IDs

Now that open_by_handle_at(2) can return u64 mount IDs, do some tests to
make sure they match properly as part of the regular open_by_handle
tests. Also, add automatic tests for the old u32 mount IDs as well.

By default, we do mount ID checks but silently skip the tests if the
syscalls are not supported by the running kernel (to ensure the tests
continue to work for old kernels). We will add some tests explicitly
checking the new features (with no silent skipping) in a future patch.

The u32 mount ID tests require STATX_MNT_ID (Linux 5.8), while the u64
mount ID tests require STATX_MNT_ID_UNIQUE (Linux 6.9) and
AT_HANDLE_MNT_ID_UNIQUE (linux-next).

Link: https://lore.kernel.org/all/20240828-exportfs-u64-mount-id-v3-0-10c2c4c16708@cyphar.com/
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/open_by_handle.c