OpenCloudOS-Kernel/fs/xfs/scrub
Darrick J. Wong 48c6615cc5 xfs: grab active perag ref when reading AG headers
This patch prepares scrub to deal with the possibility of tearing down
entire AGs by changing the order of resource acquisition to match the
rest of the XFS codebase.  In other words, scrub now grabs AG resources
in order of: perag structure, then AGI/AGF/AGFL buffers, then btree
cursors; and releases them in reverse order.

This requires us to distinguish xchk_ag_init callers -- some are
responding to a user request to check AG metadata, in which case we can
return ENOENT to userspace; but other callers have an ondisk reference
to an AG that they're trying to cross-reference.  In this second case,
the lack of an AG means there's ondisk corruption, since ondisk metadata
cannot point into nonexistent space.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
2021-08-09 11:13:17 -07:00
..
agheader.c xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
agheader_repair.c xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
alloc.c xfs: remove agno from btree cursor 2021-06-02 10:48:24 +10:00
attr.c xfs: get rid of the ip parameter to xchk_setup_* 2021-04-09 10:27:18 -07:00
attr.h xfs: only allocate memory for scrubbing attributes when we need it 2019-07-05 10:29:56 -07:00
bitmap.c treewide: Change list_sort to use const pointers 2021-04-08 16:04:22 -07:00
bitmap.h xfs: replace open-coded bitmap weight logic 2020-03-18 08:12:23 -07:00
bmap.c xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
btree.c xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
btree.h xfs: const-ify xfs_owner_info arguments 2018-12-12 08:47:16 -08:00
common.c xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
common.h xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
dabtree.c xfs: Fix fall-through warnings for Clang 2021-05-26 14:51:26 -05:00
dabtree.h xfs: refactor btree node scrubbing 2019-11-10 16:54:19 -08:00
dir.c xfs: get rid of the ip parameter to xchk_setup_* 2021-04-09 10:27:18 -07:00
fscounters.c xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
health.c xfs: move xfs_perag_get/put to xfs_ag.[ch] 2021-06-02 10:48:24 +10:00
health.h xfs: scrub should only cross-reference with healthy btrees 2019-04-16 10:01:57 -07:00
ialloc.c xfs: remove agno from btree cursor 2021-06-02 10:48:24 +10:00
inode.c xfs: grab active perag ref when reading AG headers 2021-08-09 11:13:17 -07:00
parent.c xfs: get rid of the ip parameter to xchk_setup_* 2021-04-09 10:27:18 -07:00
quota.c xfs: remove the active vs running quota differentiation 2021-08-06 11:05:37 -07:00
refcount.c xfs: remove agno from btree cursor 2021-06-02 10:48:24 +10:00
repair.c New code for 5.14: 2021-07-02 14:30:27 -07:00
repair.h xfs: get rid of the ip parameter to xchk_setup_* 2021-04-09 10:27:18 -07:00
rmap.c xfs: remove agno from btree cursor 2021-06-02 10:48:24 +10:00
rtbitmap.c xfs: get rid of the ip parameter to xchk_setup_* 2021-04-09 10:27:18 -07:00
scrub.c xfs: get rid of the ip parameter to xchk_setup_* 2021-04-09 10:27:18 -07:00
scrub.h xfs: get rid of the ip parameter to xchk_setup_* 2021-04-09 10:27:18 -07:00
symlink.c xfs: remove XFS_IFINLINE 2021-04-15 09:35:51 -07:00
trace.c xfs: remove agno from btree cursor 2021-06-02 10:48:24 +10:00
trace.h xfs: convert btree cursor inode-private member names 2020-03-13 10:37:14 -07:00
xfs_scrub.h xfs: fix scrub and remount-ro protection when running scrub 2021-04-09 10:27:13 -07:00