summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_health.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-02-19 17:01:52 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-06-01 21:16:32 -0700
commitdafd1c788b77ddf959fdbb7443e2cc31f3d30abb (patch)
tree50d6211eea377191b4d4bc2a20c2ac69129f8fff /fs/xfs/xfs_health.c
parent361935f931d3ac0920bb672373857a967928c776 (diff)
xfs: report dir/attr block corruption errors to the health system
Whenever we encounter corrupt directory or extended attribute blocks, we should report that to the health monitoring system for later reporting. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_health.c')
-rw-r--r--fs/xfs/xfs_health.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/fs/xfs/xfs_health.c b/fs/xfs/xfs_health.c
index 765188f64f7c..d8b71cba36de 100644
--- a/fs/xfs/xfs_health.c
+++ b/fs/xfs/xfs_health.c
@@ -15,6 +15,8 @@
#include "xfs_trace.h"
#include "xfs_health.h"
#include "xfs_btree.h"
+#include "xfs_da_format.h"
+#include "xfs_da_btree.h"
/*
* Warn about metadata corruption that we detected but haven't fixed, and
@@ -516,3 +518,40 @@ xfs_btree_mark_sick(
xfs_agno_mark_sick(cur->bc_mp, cur->bc_ag.agno, mask);
}
+
+/*
+ * Record observations of dir/attr btree corruption with the health tracking
+ * system.
+ */
+void
+xfs_dirattr_mark_sick(
+ struct xfs_inode *ip,
+ int whichfork)
+{
+ unsigned int mask;
+
+ switch (whichfork) {
+ case XFS_DATA_FORK:
+ mask = XFS_SICK_INO_DIR;
+ break;
+ case XFS_ATTR_FORK:
+ mask = XFS_SICK_INO_XATTR;
+ break;
+ default:
+ ASSERT(0);
+ return;
+ }
+
+ xfs_inode_mark_sick(ip, mask);
+}
+
+/*
+ * Record observations of dir/attr btree corruption with the health tracking
+ * system.
+ */
+void
+xfs_da_mark_sick(
+ struct xfs_da_args *args)
+{
+ xfs_dirattr_mark_sick(args->dp, args->whichfork);
+}