diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-02-19 17:02:57 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-03-03 18:47:54 -0800 |
commit | c96b7cc02e4c3dd5ed3baa7aeb07950db4a41d1b (patch) | |
tree | c2df8b8fe66d03aac1395284f4ae915b3397d8fa | |
parent | 9eff8c2395d540d803ad9509151bf307f2221f19 (diff) |
xfs: report realtime rmap btree corruption errors to the health systemrealtime-rmap_2020-03-03
Whenever we encounter corrupt realtime rmap btree blocks, we should
report that to the health monitoring system for later reporting.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r-- | fs/xfs/libxfs/xfs_inode_fork.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_health.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_rtalloc.c | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index 758bf44693ba..93e80435c113 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -78,8 +78,13 @@ xfs_iformat_fork( error = xfs_iformat_btree(ip, dip, XFS_DATA_FORK); break; case XFS_DINODE_FMT_RMAP: - if (!xfs_sb_version_hasrtrmapbt(&ip->i_mount->m_sb)) + if (!xfs_sb_version_hasrtrmapbt(&ip->i_mount->m_sb)) { + xfs_inode_verifier_error(ip, -EFSCORRUPTED, + __func__, dip, sizeof(*dip), + __this_address); + xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); return -EFSCORRUPTED; + } error = xfs_iformat_rmap(ip, dip); break; default: diff --git a/fs/xfs/xfs_health.c b/fs/xfs/xfs_health.c index e328b048edb0..fc0cea221985 100644 --- a/fs/xfs/xfs_health.c +++ b/fs/xfs/xfs_health.c @@ -505,6 +505,9 @@ xfs_btree_mark_sick( xfs_bmap_mark_sick(cur->bc_private.b.ip, cur->bc_private.b.whichfork); return; + case XFS_BTNUM_RTRMAP: + xfs_rt_mark_sick(cur->bc_mp, XFS_SICK_RT_RMAPBT); + return; case XFS_BTNUM_BNO: mask = XFS_SICK_AG_BNOBT; break; diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 000073e2fcc0..c27ba345b243 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -1324,6 +1324,7 @@ xfs_rtmount_inodes( if (XFS_IS_CORRUPT(mp, mp->m_rrmapip->i_d.di_format != XFS_DINODE_FMT_RMAP)) { + xfs_rt_mark_sick(mp, XFS_SICK_RT_RMAPBT); error = -EFSCORRUPTED; goto out_rrmap; } |