Commit f23c4044 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: check quota files for unwritten extents

Teach scrub to flag quota files containing unwritten extents.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 830ffa09
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "xfs_inode.h" #include "xfs_inode.h"
#include "xfs_quota.h" #include "xfs_quota.h"
#include "xfs_qm.h" #include "xfs_qm.h"
#include "xfs_bmap.h"
#include "scrub/scrub.h" #include "scrub/scrub.h"
#include "scrub/common.h" #include "scrub/common.h"
...@@ -189,11 +190,12 @@ xchk_quota_data_fork( ...@@ -189,11 +190,12 @@ xchk_quota_data_fork(
for_each_xfs_iext(ifp, &icur, &irec) { for_each_xfs_iext(ifp, &icur, &irec) {
if (xchk_should_terminate(sc, &error)) if (xchk_should_terminate(sc, &error))
break; break;
/* /*
* delalloc extents or blocks mapped above the highest * delalloc/unwritten extents or blocks mapped above the highest
* quota id shouldn't happen. * quota id shouldn't happen.
*/ */
if (isnullstartblock(irec.br_startblock) || if (!xfs_bmap_is_written_extent(&irec) ||
irec.br_startoff > max_dqid_off || irec.br_startoff > max_dqid_off ||
irec.br_startoff + irec.br_blockcount - 1 > max_dqid_off) { irec.br_startoff + irec.br_blockcount - 1 > max_dqid_off) {
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, xchk_fblock_set_corrupt(sc, XFS_DATA_FORK,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment