diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-07-02 08:42:13 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-07-07 07:15:09 -0700 |
commit | 2fb94e36b6833332057043699d3338228f6e1e2b (patch) | |
tree | 598ff401da8b54c6e22e3755fc96b263909dba94 /fs | |
parent | f866560be21966421c4a6e83079a6b76fadf667f (diff) | |
download | linux-2fb94e36b6833332057043699d3338228f6e1e2b.tar.bz2 |
xfs: rtbitmap scrubber should check inode size
Make sure the rtbitmap is large enough to store the entire bitmap.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/scrub/rtbitmap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c index c777c98c50c3..76e4ffe0315b 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)) |