summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-03-18 13:24:56 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-06-01 21:16:28 -0700
commitc9934702abd7ecf244e599cf3e1e851beadf858e (patch)
treeaddb467fe4bc586ae25522f114b96807205bdb13
parent6047423e0e061459bf02e5d2ea14192480a1d2c5 (diff)
xfs: rtbitmap scrubber should check inode sizescrub-fixes_2020-06-01
Make sure the rtbitmap is large enough to store the entire bitmap. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/xfs/scrub/rtbitmap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
index ffa4965848b7..d19bd8c29b0c 100644
--- a/fs/xfs/scrub/rtbitmap.c
+++ b/fs/xfs/scrub/rtbitmap.c
@@ -101,6 +101,13 @@ xchk_rtbitmap(
{
int error;
+ /* Is the size of the rtbitmap correct? */
+ if (sc->mp->m_rbmip->i_d.di_size !=
+ XFS_FSB_TO_B(sc->mp, sc->mp->m_sb.sb_rbmblocks)) {
+ xchk_ino_set_corrupt(sc, sc->mp->m_rbmip->i_ino);
+ return 0;
+ }
+
/* Invoke the fork scrubber. */
error = xchk_metadata_inode_forks(sc);
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))