summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/common.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:05:47 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:16:31 -0700
commit25aa73190a8c9935b1282476026fd67ae230659b (patch)
treeef221afcac524ed4473ce9c15001609690bc9664 /fs/xfs/scrub/common.c
parent7c11018a8ce3a069a21038e5bef21b90adc38670 (diff)
xfs: retain the AGI when we can't iget an inode to scrub the corescrub-iget-fixes_2022-10-14
xchk_get_inode is not quite the right function to be calling from the inode scrubber setup function. The common get_inode function either gets an inode and installs it in the scrub context, or it returns an error code explaining what happened. This is acceptable for most file scrubbers because it is not in their scope to fix corruptions in the inode core and fork areas that cause iget to fail. Dealing with these problems is within the scope of the inode scrubber, however. If iget fails with EFSCORRUPTED, we need to xchk_inode to flag that as corruption. Since we can't get our hands on an incore inode, we need to hold the AGI to prevent inode allocation activity so that nothing changes in the inode metadata. Looking ahead to the inode core repair patches, we will also need to hold the AGI buffer into xrep_inode so that we can make modifications to the xfs_dinode structure without any other thread swooping in to allocate or free the inode. Adapt the xchk_get_inode into xchk_setup_inode since this is a one-off use case where the error codes we check for are a little different, and the return state is much different from the common function. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/common.c')
-rw-r--r--fs/xfs/scrub/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index 9a811c5fa8f7..dd60c7ced780 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -788,7 +788,7 @@ again:
}
/* Install an inode that we opened by handle for scrubbing. */
-static int
+int
xchk_install_handle_inode(
struct xfs_scrub *sc,
struct xfs_inode *ip)