]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - libxfs/xfs_bmap.c
xfs: bmapbt checking on debug kernels too expensive
[thirdparty/xfsprogs-dev.git] / libxfs / xfs_bmap.c
index 70417fc79ea3e56054839fbd8185720be7ec3425..eb19133c98f1abfe29cce5ae4fd91949123345fc 100644 (file)
@@ -317,9 +317,11 @@ xfs_check_block(
 
 /*
  * Check that the extents for the inode ip are in the right order in all
- * btree leaves.
+ * btree leaves. THis becomes prohibitively expensive for large extent count
+ * files, so don't bother with inodes that have more than 10,000 extents in
+ * them. The btree record ordering checks will still be done, so for such large
+ * bmapbt constructs that is going to catch most corruptions.
  */
-
 STATIC void
 xfs_bmap_check_leaf_extents(
        xfs_btree_cur_t         *cur,   /* btree cursor or null */
@@ -344,6 +346,10 @@ xfs_bmap_check_leaf_extents(
                return;
        }
 
+       /* skip large extent count inodes */
+       if (ip->i_d.di_nextents > 10000)
+               return;
+
        bno = NULLFSBLOCK;
        mp = ip->i_mount;
        ifp = XFS_IFORK_PTR(ip, whichfork);