diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-07-14 11:05:47 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-10-14 14:16:31 -0700 |
commit | 25aa73190a8c9935b1282476026fd67ae230659b (patch) | |
tree | ef221afcac524ed4473ce9c15001609690bc9664 /mm/userfaultfd.c | |
parent | 7c11018a8ce3a069a21038e5bef21b90adc38670 (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 'mm/userfaultfd.c')
0 files changed, 0 insertions, 0 deletions