xfs/030: hide the btree levels check errors
[xfstests-dev.git] / common / repair
index 537d943fa3da2d768ead1861732cabc166c9949e..8adc2178a728ebe531eb0f010ace2ed70e3e903a 100644 (file)
@@ -1,23 +1,8 @@
 ##/bin/bash
-#
+# SPDX-License-Identifier: GPL-2.0
 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-#
 # Functions useful for xfs_repair tests
-#
 
 _zero_position()
 {
@@ -34,7 +19,7 @@ _zero_position()
                exit
        fi
        length=`expr $length / 512`
-       src/devzero -v $value -b 1 -n $length -o $offset $SCRATCH_DEV \
+       $here/src/devzero -v $value -b 1 -n $length -o $offset $SCRATCH_DEV \
                | perl -npe 's/\d\.\d\dKb/X.XXKb/g'
 }
 
@@ -44,7 +29,13 @@ _filter_repair()
 # for sb
 /- agno = / && next;   # remove each AG line (variable number)
 s/(pointer to) (\d+)/\1 INO/;
-s/(sb root inode value) (\d+)( \(NULLFSINO\))?/\1 INO/;
+# Changed inode output in 5.5.0
+s/sb root inode value /sb root inode /;
+s/realtime bitmap inode value /realtime bitmap inode /;
+s/realtime summary inode value /realtime summary inode /;
+s/ino pointer to /inode pointer to /;
+#
+s/(sb root inode) (\d+)( \(NULLFSINO\))?/\1 INO/;
 s/(realtime bitmap inode) (\d+)( \(NULLFSINO\))?/\1 INO/;
 s/(realtime summary inode) (\d+)( \(NULLFSINO\))?/\1 INO/;
 s/(inconsistent with calculated value) (\d+)/\1 INO/;
@@ -54,6 +45,7 @@ s/(bad length -{0,1}\d+ for ag. 0, should be) (\d+)/\1 LENGTH/;
 s/(bad length # -{0,1}\d+ for ag. 0, should be) (\d+)/\1 LENGTH/;
 s/(bad agbno) (\d+)/\1 AGBNO/g;
 s/(max =) (\d+)/\1 MAX/g;
+s/(bad levels) (\d+) (for [a-z]* root, agno) (\d+)/\1 LEVELS \3 AGNO/;
 # for root inos
 s/(on inode) (\d+)/\1 INO/g;
 s/(imap claims a free inode) (\d+)/\1 INO/;
@@ -89,13 +81,27 @@ s/(inode chunk) (\d+)\/(\d+)/AGNO\/INO/;
 # sunit/swidth reset messages
 s/^(Note - .*) were copied.*/\1 fields have been reset./;
 s/^(Please) reset (with .*) if necessary/\1 set \2/;
+# remove new unlinked inode test
+/^bad next_unlinked/ && next;
+# And make them generic so we dont depend on geometry
+s/(stripe unit) \(.*\) (and width) \(.*\)/\1 (SU) \2 (SW)/;
 # corrupt sb messages
 s/(superblock) (\d+)/\1 AGNO/;
 s/(AG \#)(\d+)/\1AGNO/;
 s/(reset bad sb for ag) (\d+)/\1 AGNO/;
+s/(unknown block state, ag )(\d+)(, blocks? )(\d+)/\1AGNO\3AGBNO/;
+/^Note - quota info will be regenerated on next quota mount.$/ && next;
        print;'
 }
 
+# Filter out unknown block state messages that appear when rmap is enabled
+# and we erase a btree root pointer (such that repair never finds the
+# tree and fails to reconcile the metadata reverse mappings against the
+# metadata).
+_filter_repair_lostblocks() {
+       _filter_repair | sed -e '/unknown block state, ag AGNO, blocks* AGBNO/d'
+}
+
 _filter_dd()
 {
        fgrep -v records        # lose records in/out lines