summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/refcount_repair.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 10:46:26 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-09-17 18:54:54 -0700
commita28e5fb9482710dc8f43aa92d7b3849e0e37d92b (patch)
tree7662a344a66f0d4b25a163f8c7ae7ac06301dfd9 /fs/xfs/scrub/refcount_repair.c
parentd02ba8727283ebc7a0acebd90f256595d5b7abc8 (diff)
xfs: report XFS_CORRUPT_ON errors to the health systemcorruption-health-reports_2021-09-17
Whenever we encounter XFS_CORRUPT_ON failures, we should report that to the health monitoring system for later reporting. I started with this and massaged everything until it built: @@ expression mp, test; @@ - if (XFS_CORRUPT_ON(mp, test)) return -EFSCORRUPTED; + if (XFS_CORRUPT_ON(mp, test)) { xfs_btree_mark_sick(cur); return -EFSCORRUPTED; } @@ expression mp, test; identifier label, error; @@ - if (XFS_CORRUPT_ON(mp, test)) { error = -EFSCORRUPTED; goto label; } + if (XFS_CORRUPT_ON(mp, test)) { xfs_btree_mark_sick(cur); error = -EFSCORRUPTED; goto label; } Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/refcount_repair.c')
-rw-r--r--fs/xfs/scrub/refcount_repair.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/scrub/refcount_repair.c b/fs/xfs/scrub/refcount_repair.c
index 33c0cd8df4fa..63069c586683 100644
--- a/fs/xfs/scrub/refcount_repair.c
+++ b/fs/xfs/scrub/refcount_repair.c
@@ -23,6 +23,7 @@
#include "xfs_refcount_btree.h"
#include "xfs_error.h"
#include "xfs_ag.h"
+#include "xfs_health.h"
#include "scrub/xfs_scrub.h"
#include "scrub/scrub.h"
#include "scrub/common.h"
@@ -223,6 +224,7 @@ xrep_refc_next_rrm(
if (error)
goto out_error;
if (XFS_IS_CORRUPT(mp, !have_gt)) {
+ xfs_btree_mark_sick(cur);
error = -EFSCORRUPTED;
goto out_error;
}
@@ -349,6 +351,7 @@ xrep_refc_find_refcounts(
if (error)
goto out_bag;
if (XFS_IS_CORRUPT(sc->mp, !have_gt)) {
+ xfs_btree_mark_sick(sc->sa.rmap_cur);
error = -EFSCORRUPTED;
goto out_bag;
}
@@ -398,6 +401,7 @@ xrep_refc_find_refcounts(
if (error)
goto out_bag;
if (XFS_IS_CORRUPT(sc->mp, !have_gt)) {
+ xfs_btree_mark_sick(sc->sa.rmap_cur);
error = -EFSCORRUPTED;
goto out_bag;
}