tag name | scrub-detect-refcount-gaps_2022-11-09 (cdb23eb932fff5c8d7cfab2ad296830005320c8b) |
tag date | 2022-11-09 19:09:41 -0800 |
tagged by | Darrick J. Wong <djwong@kernel.org> |
tagged object | commit eda0e35702... |
xfs: detect incorrect gaps in refcount btree
The next few patchsets address a deficiency in scrub that I found while
QAing the refcount btree scrubber. If there's a gap between refcount
records, we need to cross-reference that gap with the reverse mappings
to ensure that there are no overlapping records in the rmap btree. If
we find any, then the refcount btree is not consistent. This is not a
property that is specific to the refcount btree; they all need to have
this sort of keyspace scanning logic to detect inconsistencies.
To do this accurately, we need to be able to scan the keyspace of a
btree (which we already do) to be able to tell the caller if the
keyspace is empty, sparse, or fully covered by records. The first few
patches add the keyspace scanner to the generic btree code, along with
the ability to mask off parts of btree keys because when we scan the
rmapbt, we only care about space usage, not the owners.
The final patch closes the scanning gap in the refcountbt scanner.
v23.1: create helpers for the key extraction and comparison functions,
improve documentation, and eliminate the ->mask_key indirect
calls
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEUzaAxoMeQq6m2jMV+H93GTRKtOsFAmNsa3UACgkQ+H93GTRK
tOvB5A//bW0ayFe6NhSprSR/PIpivCFu5q+k6fDoVpDLKt9fjeFpFmJyT9scM/1w
VQL/7vgkgwVFlF5rEMLoIzM3V4Sf3ghj7DFzP6n+aTrSEg+RDlAZAuvs8tzzK9Ea
MLd2T/AfVosK161lLCrbBj+HoTAAaTcQNjGmiSYDk3SPpQZim7eHZyMdKX3I9qTe
JAkY/HPFO49giyD2G2kOnq5d4bOU5fhNtW0Y+Dltf/lGeslZ1JiakLEvelaxE43h
AU6OmD8BsAoOGUwXe1hUG0laPGJvxbAdMpy8hPlUi6DdsNJhkp/rpsV310GsCAll
oqnm0+UmjqKvw2LivMlTiWAlh949yNrbd3DIxr9eYcpvc/2nL4zjIxZUgVV9V9bu
f5epNrc2pW2Lqm3fVlr1y3LpxatMdYnHjQosRfUMux/1meSMMx5u7SqcwbKzaJkv
cd+U5/sm4Ol0THz9Qvs45EI0oqpeXnxpD1V7qZ5H5uGyPbuxX7Ic78tY/5A5sZDt
uRTApzN1/2HainWeZWjVD56HF9WEfdMqnLM473VHB0lDxP5Q4AviKp9alAYEWZVL
JK27H95OLeE3VHQxPTRjh+Jt++POp3Jp3jlbYtRKBXScPeaOorqZsR5yrGx5MnDc
8J3FhclSAy7QqXcK7teuFL7kEXdDIQfrHllfgNUl98bfT3zYDI8=
=qqdQ
-----END PGP SIGNATURE-----