configure: check for FS_IOC_READ_VERITY_METADATA availability
Commit
6bfa843b4435334ac073e42950b48d8bacb54977 ("mke2fs: enable
copying of fs-verity metadata") introduced support for reading
fs-verity metadata, which requires using the
FS_IOC_READ_VERITY_METADATA.
The code is conditionally compiled when the kernel headers have
<linux/fsverity.h> available. Unfortunately, this check is not
sufficient: <linux/fsverity.h> was introduced in Linux 5.10, but the
FS_IOC_READ_VERITY_METADATA was not introduced before 5.12, so if one
is using 5.10 or 5.11 kernel headers, the build fails with:
./../misc/create_inode.c: In function ‘copy_fs_verity_data’:
./../misc/create_inode.c:589:10: error: variable ‘arg’ has initializer but incomplete type
589 | struct fsverity_read_metadata_arg arg = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
[...]
./../misc/create_inode.c:600:20: error: ‘FS_IOC_READ_VERITY_METADATA’ undeclared (first use in this function)
600 | size = ioctl(fd, FS_IOC_READ_VERITY_METADATA, &arg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit therefore extends the configure.ac check to ensure that
not only <linux/fsverity.h> exists but also that it defines the
FS_IOC_READ_VERITY_METADATA ioctl.
Closes: https://github.com/tytso/e2fsprogs/pull/256
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>