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-11-09 19:07:18 -0800
commit30d20f3e3b76fe0230c7a3e6890e31775320263c (patch)
tree91e96b9f3be841c95c0df8aff6d2e24b8e541809 /fs/xfs/scrub/common.c
parent82344f01980316e5250bafd3366d1bc375c928bf (diff)
xfs: retain the AGI when we can't iget an inode to scrub the corescrub-iget-fixes_2022-11-09
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 bcde8076c0aa..a43ba7915eef 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)