tag name | repair-rmap-live_2021-10-22 (06dd226bc759353990d2cc3a1e0a8b3cf69dd277) |
tag date | 2021-10-22 16:45:47 -0700 |
tagged by | Darrick J. Wong <djwong@kernel.org> |
tagged object | commit 058725b83f... |
xfs: repair rmap btrees without freezing
The last time I sent out online repair for review, Dave Chinner noted
that online repair isn't that any better than offline repair if we have
to freeze the entire filesystem to scan every file in the filesystem.
I don't agree with the degree of that assessment (you don't have to
unmount!) it's quite possible to do better.
This patchset modifies the xfs buffer cache to be capable of using an
xfile (aka a shmem file) as a backing device, in addition to regular
block devices. It then augments the btree code to support creating
btree cursors with buffers that come from a buftarg other than the data
device (namely an xfile-backed buftarg) and then revamps the rmap and
rtrmap repair code to build an in-memory btree instead of the xfarray
that the initial version used.
Finally, we wire up a new hook in the rmap code so that the rmap repair
code can receive notifications of updates going on from other threads.
With this capability, the rmap repair code can scan the whole filesystem
without holding locks (or freezing the fs) to create an in-memory btree;
and other writer threads help us keep it up to date.
IOWs, this eliminates all but one of the online fsck types that require
freezing.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEUzaAxoMeQq6m2jMV+H93GTRKtOsFAmFzTSsACgkQ+H93GTRK
tOvBVQ/+IbRUOocElshZV1axtUbMcfamYbQLygSPIxkbexauN/XJEsu2bNS7h8QI
v2wd0uCvBgUXW27vS9Ec0kYjhxJfAjXbBlP7oXwED48a/rCiE1e9aXGG9kQ+IAjH
gonfPVZMwQpJFJivKgFDkgEwTMwh5EiRtmB5KjC9Qh2moIGBU0Zz9ZtYZ5wfWQmH
0PKWOeWV+pcY1j86q6AfKzMpCbGVEJEBbLKJWG2IuH+Q5+8IP23QM7072KMN5vs3
FK0ArO2urMID7NriOZTrrDAgn68eb7URs0PvZ5tDCMRQFuhqtwNHYRvO2LoqGhXA
vdiY+k/a5O34YRvqkfnMf+bipEQnR9oGOI9BrlDDiqac+Seo1fWrnFeMqctyk1l6
2NbArJYgDGEc4D20V/f4xMNlZkdrWt+IGHP416o5XdHos/8d199NTrVyI0zjfXxk
JrIXzn96nxregh/qGRDfnrr39L7bfeIH/VvXjG4yFf/z8dNFw5z7FL0W1qw3S8L8
FdMYqTS/8HvaeQm5jOkNdWxHUuh9H0XTBDJJPBazNsel++4oSGGJMQ5O1uKz6Dqa
Ion5hk6h+gqgDxecNjDoLawwFcfnH8qKiZeH2J9mXuKzDYua7/ql88dOYfcNQ7SA
tQkZLGoG8mR9CgSEVBvQnp+Zy6nzsbtH7grztzgctb/xYOBFoPA=
=qCX9
-----END PGP SIGNATURE-----