1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
.\" Copyright (c) 2023-2024 Oracle. All rights reserved.
.\"
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" SPDX-License-Identifier: GPL-2.0-or-later
.\" %%%LICENSE_END
.TH IOCTL-XFS-SCRUBV-METADATA 2 2024-05-21 "XFS"
.SH NAME
ioctl_xfs_scrubv_metadata \- check a lot of XFS filesystem metadata
.SH SYNOPSIS
.br
.B #include <xfs/xfs_fs.h>
.PP
.BI "int ioctl(int " dest_fd ", XFS_IOC_SCRUBV_METADATA, struct xfs_scrub_vec_head *" arg );
.SH DESCRIPTION
This XFS ioctl asks the kernel driver to examine several pieces of filesystem
metadata for errors or suboptimal metadata.
Multiple scrub types can be invoked to target a single filesystem object.
See
.BR ioctl_xfs_scrub_metadata (2)
for a discussion of metadata validation, and documentation of the various
.B XFS_SCRUB_TYPE
and
.B XFS_SCRUB_FLAGS
values referenced below.
The types and location of the metadata to scrub are conveyed as a vector with
a header of the following form:
.PP
.in +4n
.nf
struct xfs_scrub_vec_head {
__u64 svh_ino;
__u32 svh_gen;
__u32 svh_agno;
__u32 svh_flags;
__u16 svh_rest_us;
__u16 svh_nr;
__u64 svh_reserved;
__u64 svh_vectors;
};
.fi
.in
.PP
The field
.IR svh_ino ,
.IR svh_gen ,
and
.IR svh_agno
correspond to the
.IR sm_ino ,
.IR sm_gen ,
and
.IR sm_agno
fields of the regular scrub ioctl.
Exactly one filesystem object can be specified in a single call.
The kernel will proceed with each vector in
.I svh_vectors
until progress is no longer possible.
The field
.I svh_rest_us
specifies an amount of time to pause between each scrub invocation to give
the system a chance to process other requests.
The field
.I svh_nr
specifies the number of vectors in the
.I svh_vectors
array.
The field
.I svh_vectors
is a pointer to an array of
.B struct xfs_scrub_vec
structures.
.PP
The field
.I svh_reserved
must be zero.
Each vector has the following form:
.PP
.in +4n
.nf
struct xfs_scrub_vec {
__u32 sv_type;
__u32 sv_flags;
__s32 sv_ret;
__u32 sv_reserved;
};
.fi
.in
.PP
The fields
.I sv_type
and
.I sv_flags
indicate the type of metadata to check and the behavioral changes that
userspace will permit of the kernel.
The
.I sv_flags
field will be updated upon completion of the scrub call.
See the documentation of
.B XFS_SCRUB_TYPE_*
and
.B XFS_SCRUB_[IO]FLAG_*
values in
.BR ioctl_xfs_scrub_metadata (2)
for a detailed description of their purpose.
.PP
If a vector's
.I sv_type
field is set to the value
.BR XFS_SCRUB_TYPE_BARRIER ,
the kernel will stop processing vectors and return to userspace if a scrubber
flags corruption by setting one of the
.B XFS_SCRUB_OFLAG_*
values in
.I sv_flags
or
returns an operation error in
.IR sv_ret .
Otherwise, the kernel returns only after processing all vectors.
The
.I sv_ret
field is set to the return value of the scrub function.
See the RETURN VALUE
section of the
.BR ioctl_xfs_scrub_metadata (2)
manual page for more information.
The
.B sv_reserved
field must be zero.
.SH RETURN VALUE
On error, \-1 is returned, and
.I errno
is set to indicate the error.
.PP
.SH ERRORS
Error codes can be one of, but are not limited to, the following:
.TP
.B EINVAL
One or more of the arguments specified is invalid.
.TP
.B EINTR
The operation was interrupted.
.TP
.B ENOMEM
There was not sufficient memory to perform the scrub or repair operation.
.TP
.B EFAULT
A memory fault was encountered while reading or writing the vector.
.SH CONFORMING TO
This API is specific to XFS filesystem on the Linux kernel.
.SH NOTES
These operations may block other filesystem operations for a long time.
A calling process can stop the operation by being sent a fatal
signal, but non-fatal signals are blocked.
.SH SEE ALSO
.BR ioctl (2)
.BR ioctl_xfs_scrub_metadata (2)
.BR xfs_scrub (8)
.BR xfs_repair (8)
|