diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-02-19 17:01:51 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-06-01 21:16:32 -0700 |
commit | 9c696d26f2635328e6bd21f349abf64aef5f31a9 (patch) | |
tree | 0a86f59b6a4e182f6d18cd26245add8f53811c6a /fs/xfs/xfs_health.c | |
parent | eb26b66d289fdf1563075f0eda4187785b99222a (diff) |
xfs: report block map corruption errors to the health tracking system
Whenever we encounter a corrupt block mapping, 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.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/xfs/xfs_health.c b/fs/xfs/xfs_health.c index 36c32b108b39..5e5de5338476 100644 --- a/fs/xfs/xfs_health.c +++ b/fs/xfs/xfs_health.c @@ -452,3 +452,29 @@ xfs_bulkstat_health( bs->bs_sick |= m->ioctl_mask; } } + +/* Mark a block mapping sick. */ +void +xfs_bmap_mark_sick( + struct xfs_inode *ip, + int whichfork) +{ + unsigned int mask; + + switch (whichfork) { + case XFS_DATA_FORK: + mask = XFS_SICK_INO_BMBTD; + break; + case XFS_ATTR_FORK: + mask = XFS_SICK_INO_BMBTA; + break; + case XFS_COW_FORK: + mask = XFS_SICK_INO_BMBTC; + break; + default: + ASSERT(0); + return; + } + + xfs_inode_mark_sick(ip, mask); +} |