]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: report XFS_IS_CORRUPT errors to the health system
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 17:00:55 +0000 (10:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:36 +0000 (11:37 -0700)
commit4467a60ab58e63c4c97f149fc6f6c0254318357e
tree6979718d9cabd49f4a338f511b6b5f5ddfd55393
parentbb9be3f86809922ed5ffceeec508c9a96ad0e305
xfs: report XFS_IS_CORRUPT errors to the health system

Source kernel commit: 989d5ec3175be7c0012d7744c667ae6a266fab06

Whenever we encounter XFS_IS_CORRUPT failures, we should report that to
the health monitoring system for later reporting.

I started with this semantic patch and massaged everything until it
built:

@@
expression mp, test;
@@

- if (XFS_IS_CORRUPT(mp, test)) return -EFSCORRUPTED;
+ if (XFS_IS_CORRUPT(mp, test)) { xfs_btree_mark_sick(cur); return -EFSCORRUPTED; }

@@
expression mp, test;
identifier label, error;
@@

- if (XFS_IS_CORRUPT(mp, test)) { error = -EFSCORRUPTED; goto label; }
+ if (XFS_IS_CORRUPT(mp, test)) { xfs_btree_mark_sick(cur); error = -EFSCORRUPTED; goto label; }

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
libxfs/xfs_ag.c
libxfs/xfs_alloc.c
libxfs/xfs_attr_remote.c
libxfs/xfs_bmap.c
libxfs/xfs_btree.c
libxfs/xfs_ialloc.c
libxfs/xfs_refcount.c
libxfs/xfs_rmap.c