summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_attr_inactive.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-02-22 12:32:18 -0800
committerDarrick J. Wong <djwong@kernel.org>2024-02-22 12:32:18 -0800
commitca14c0968c1f693ab4bcb5368c800c33e7a2ad7e (patch)
treef7d5afbf2de3956a8b17939837538a3288314842 /fs/xfs/xfs_attr_inactive.c
parenta78d10f45b23149f1b23019a4f4fb57dcf852e39 (diff)
downloadlinux-stable-ca14c0968c1f693ab4bcb5368c800c33e7a2ad7e.tar.gz
linux-stable-ca14c0968c1f693ab4bcb5368c800c33e7a2ad7e.tar.bz2
linux-stable-ca14c0968c1f693ab4bcb5368c800c33e7a2ad7e.zip
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 <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_attr_inactive.c')
-rw-r--r--fs/xfs/xfs_attr_inactive.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index 89c7a9f4f930..24fb12986a56 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -23,6 +23,7 @@
#include "xfs_quota.h"
#include "xfs_dir2.h"
#include "xfs_error.h"
+#include "xfs_health.h"
/*
* Invalidate any incore buffers associated with this remote attribute value
@@ -147,6 +148,7 @@ xfs_attr3_node_inactive(
if (level > XFS_DA_NODE_MAXDEPTH) {
xfs_buf_mark_corrupt(bp);
xfs_trans_brelse(*trans, bp); /* no locks for later trans */
+ xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
return -EFSCORRUPTED;
}
@@ -197,6 +199,7 @@ xfs_attr3_node_inactive(
default:
xfs_buf_mark_corrupt(child_bp);
xfs_trans_brelse(*trans, child_bp);
+ xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
error = -EFSCORRUPTED;
break;
}
@@ -286,6 +289,7 @@ xfs_attr3_root_inactive(
error = xfs_attr3_leaf_inactive(trans, dp, bp);
break;
default:
+ xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
error = -EFSCORRUPTED;
xfs_buf_mark_corrupt(bp);
xfs_trans_brelse(*trans, bp);