summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/bmap.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-05-14 16:34:32 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2018-05-16 04:12:50 +0300
commit8bc763c24de745608679b128e2e5e25c5070f7d3 (patch)
tree11c6f4f21f3709f61aa10ab734b4e3fd44474708 /fs/xfs/scrub/bmap.c
parenteac69e167665d342b741986e9d0b53a0a26a6608 (diff)
downloadlinux-8bc763c24de745608679b128e2e5e25c5070f7d3.tar.xz
xfs: don't continue scrub if already corrupt
If we've already decided that something is corrupt, we might as well abort all the loops and exit as quickly as possible. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/bmap.c')
-rw-r--r--fs/xfs/scrub/bmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index e5a4611abf86..42a115e83739 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -683,7 +683,8 @@ xfs_scrub_bmap(
info.lastoff = 0;
ifp = XFS_IFORK_PTR(ip, whichfork);
for_each_xfs_iext(ifp, &icur, &irec) {
- if (xfs_scrub_should_terminate(sc, &error))
+ if (xfs_scrub_should_terminate(sc, &error) ||
+ (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
break;
if (isnullstartblock(irec.br_startblock))
continue;