summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:06:21 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-11-09 19:07:31 -0800
commitab394b195f283f5ab0520ee293762ac5f7d5800c (patch)
tree2fa33f262bda7bc2a49be1b1dfa45104d0ed3bb9 /fs/xfs/scrub
parent954045613421f5b3622f46bfa2a3b63fb7fdda3a (diff)
xfs: separate the marking of sick and checked metadata
Split the setting of the sick and checked masks into separate functions as part of preparing to add the ability for regular runtime fs code (i.e. not scrub) to mark metadata structures sick when corruptions are found. Improve the documentation of libxfs' requirements for helper behavior. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/health.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/xfs/scrub/health.c b/fs/xfs/scrub/health.c
index 6749930b50a2..e5cc89d43808 100644
--- a/fs/xfs/scrub/health.c
+++ b/fs/xfs/scrub/health.c
@@ -144,30 +144,34 @@ xchk_update_health(
switch (type_to_health_flag[sc->sm->sm_type].group) {
case XHG_AG:
pag = xfs_perag_get(sc->mp, sc->sm->sm_agno);
- if (bad)
+ if (bad) {
xfs_ag_mark_sick(pag, sc->sick_mask);
- else
+ xfs_ag_mark_checked(pag, sc->sick_mask);
+ } else
xfs_ag_mark_healthy(pag, sc->sick_mask);
xfs_perag_put(pag);
break;
case XHG_INO:
if (!sc->ip)
return;
- if (bad)
+ if (bad) {
xfs_inode_mark_sick(sc->ip, sc->sick_mask);
- else
+ xfs_inode_mark_checked(sc->ip, sc->sick_mask);
+ } else
xfs_inode_mark_healthy(sc->ip, sc->sick_mask);
break;
case XHG_FS:
- if (bad)
+ if (bad) {
xfs_fs_mark_sick(sc->mp, sc->sick_mask);
- else
+ xfs_fs_mark_checked(sc->mp, sc->sick_mask);
+ } else
xfs_fs_mark_healthy(sc->mp, sc->sick_mask);
break;
case XHG_RT:
- if (bad)
+ if (bad) {
xfs_rt_mark_sick(sc->mp, sc->sick_mask);
- else
+ xfs_rt_mark_checked(sc->mp, sc->sick_mask);
+ } else
xfs_rt_mark_healthy(sc->mp, sc->sick_mask);
break;
default: