xfs: don't clobber inobt/finobt cursors when xref with rmap
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 23 Jan 2018 19:17:47 +0000 (11:17 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 29 Jan 2018 15:27:23 +0000 (07:27 -0800)
Even if we can't use the inobt/finobt cursors to count the number of
inode btree blocks, we are never allowed to clobber the cursor of the
btree being checked, so don't do this.  Found by fuzzing level = ones
in xfs/364.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/ialloc.c

index 21c850abbafd7dcd379c4ecef0e12496bdedb560..63ab3f98430d7f3cd3c18ba4696e105253d490a0 100644 (file)
@@ -391,12 +391,12 @@ xfs_scrub_iallocbt_xref_rmap_btreeblks(
 
        /* Check that we saw as many inobt blocks as the rmap says. */
        error = xfs_btree_count_blocks(sc->sa.ino_cur, &inobt_blocks);
-       if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.ino_cur))
+       if (!xfs_scrub_process_error(sc, 0, 0, &error))
                return;
 
        if (sc->sa.fino_cur) {
                error = xfs_btree_count_blocks(sc->sa.fino_cur, &finobt_blocks);
-               if (!xfs_scrub_should_check_xref(sc, &error, &sc->sa.fino_cur))
+               if (!xfs_scrub_process_error(sc, 0, 0, &error))
                        return;
        }