[PATCH v8 00/22] xfs: online scrub support

Darrick J. Wong
2017-07-21T04:38:32Z

Hi all,

This is the eighth revision of a patchset that adds to XFS kernel
support for online metadata scrubbing and repair. There aren't any
on-disk format changes. Changes since v7 include adding scrubbers for
metadata buffers that were sitting around in memory before scrub
started, scrubbers for directory parent pointers, and scrubbers for
quota counters. I have been performing daily online scrubs of my XFS
filesystems for several months now, with surprisingly few problems.

Online scrub/repair support consists of four major pieces -- first, an
ioctl that maps physical extents to their owners (GETFSMAP; already in
4.12); second, various in-kernel metadata scrubbing ioctls to examine
metadata records and cross-reference them with other filesystem
metadata; third, an in-kernel mechanism for rebuilding damaged metadata
objects and btrees; and fourth, a userspace component to coordinate
scrubbing and repair operations.

This new utility, xfs_scrub, is separate from the existing offline
xfs_repair tool. The program uses various XFS ioctls to iterate all XFS
metadata and asks the kernel to check the metadata and repair it if
necessary.

Per reviewer request, the v8 patch series will be broken into multiple
smaller series -- the first series adds the scrub functionality, and the
second series will contain all the userspace code. The third series
will add cross-referencing checks, and the fourth series will add online
repair functionality.

While I understand that reviewer bandwidth is limited, I would like to
get this series prepped for 4.14, if possible. I have isolated the
scrub code such that it can be compiled out entirely, in the hopes that
we can stabilize the code while not exposing regular users to riskier
code.

If you're going to start using this mess, you probably ought to just
pull from my git trees. The kernel patches[1] should apply against
4.13-rc1. xfsprogs[2] and xfstests[3] can be found in their usual
places. The git trees contain all four series' worth of changes.

This is an extraordinary way to eat your data. Enjoy!
Comments and questions are, as always, welcome.

--D

[1] https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=djwong-devel
[2] https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=djwong-devel
[3] https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=djwong-devel