xfs: report XFS_IS_CORRUPT errors to the health system
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>
Showing
- fs/xfs/libxfs/xfs_ag.c 3 additions, 1 deletionfs/xfs/libxfs/xfs_ag.c
- fs/xfs/libxfs/xfs_alloc.c 81 additions, 16 deletionsfs/xfs/libxfs/xfs_alloc.c
- fs/xfs/libxfs/xfs_attr_remote.c 6 additions, 2 deletionsfs/xfs/libxfs/xfs_attr_remote.c
- fs/xfs/libxfs/xfs_bmap.c 84 additions, 10 deletionsfs/xfs/libxfs/xfs_bmap.c
- fs/xfs/libxfs/xfs_btree.c 13 additions, 1 deletionfs/xfs/libxfs/xfs_btree.c
- fs/xfs/libxfs/xfs_ialloc.c 43 additions, 9 deletionsfs/xfs/libxfs/xfs_ialloc.c
- fs/xfs/libxfs/xfs_refcount.c 36 additions, 1 deletionfs/xfs/libxfs/xfs_refcount.c
- fs/xfs/libxfs/xfs_rmap.c 73 additions, 4 deletionsfs/xfs/libxfs/xfs_rmap.c
- fs/xfs/scrub/refcount_repair.c 7 additions, 2 deletionsfs/xfs/scrub/refcount_repair.c
- fs/xfs/xfs_attr_list.c 7 additions, 2 deletionsfs/xfs/xfs_attr_list.c
- fs/xfs/xfs_dir2_readdir.c 5 additions, 1 deletionfs/xfs/xfs_dir2_readdir.c
- fs/xfs/xfs_discard.c 2 additions, 0 deletionsfs/xfs/xfs_discard.c
- fs/xfs/xfs_iwalk.c 4 additions, 1 deletionfs/xfs/xfs_iwalk.c
Please register or sign in to comment