summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-02-19 17:02:57 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-06-01 21:16:47 -0700
commit57230a844458bc519a1ba576eeafe6ac3bc5eac1 (patch)
tree1d2219e759843d29fff0515d77c7755e3851aef8
parent9a47046b0ace21791676aab53bebcd65b811e919 (diff)
xfs: report realtime rmap btree corruption errors to the health systemrealtime-rmap_2020-06-01
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.c7
-rw-r--r--fs/xfs/xfs_health.c3
-rw-r--r--fs/xfs/xfs_rtalloc.c1
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 e72751af4239..9204ff32ee58 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 7d7179e83eb6..57222de9372e 100644
--- a/fs/xfs/xfs_health.c
+++ b/fs/xfs/xfs_health.c
@@ -504,6 +504,9 @@ xfs_btree_mark_sick(
case XFS_BTNUM_BMAP:
xfs_bmap_mark_sick(cur->bc_ino.ip, cur->bc_ino.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;
}