From d17a62753462c0f3a4ba95e1ac08c2c1c40ddabb Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 16 Nov 2017 22:11:31 -0600 Subject: [PATCH] xfs: probe the scrub ioctl Source kernel commit: dcb660f9222fd9f607e7e05f4755b39b809ca19f Create a probe scrubber with id 0. This will be used by xfs_scrub to probe the kernel's abilities to scrub (and repair) the metadata. We do this by validating the ioctl inputs from userspace, preparing the filesystem for a scrub (or a repair) operation, and immediately returning to userspace. Userspace can use the returned errno and structure state to decide (in broad terms) if scrub/repair are supported by the running kernel. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Eric Sandeen --- libxfs/xfs_fs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index be235e826..cff4358d9 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -504,9 +504,10 @@ struct xfs_scrub_metadata { */ /* Scrub subcommands. */ +#define XFS_SCRUB_TYPE_PROBE 0 /* presence test ioctl */ /* Number of scrub subcommands. */ -#define XFS_SCRUB_TYPE_NR 0 +#define XFS_SCRUB_TYPE_NR 1 /* i: Repair this metadata. */ #define XFS_SCRUB_IFLAG_REPAIR (1 << 0) -- 2.47.2