]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs: filter and record the unknown block state messages
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 1 Nov 2017 21:47:36 +0000 (14:47 -0700)
committerEryu Guan <eguan@redhat.com>
Fri, 3 Nov 2017 11:04:49 +0000 (19:04 +0800)
Record the unknown block state messages that xfs_repair produces
when we nuke the finobt.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/repair
tests/xfs/010
tests/xfs/030

index 2b1583b7e730c3fa6e7bf6bef5d776f467834a11..b5695413840107255434da3aa46cd0e0942599cf 100644 (file)
@@ -95,9 +95,18 @@ s/(stripe unit) \(.*\) (and width) \(.*\)/\1 (SU) \2 (SW)/;
 s/(superblock) (\d+)/\1 AGNO/;
 s/(AG \#)(\d+)/\1AGNO/;
 s/(reset bad sb for ag) (\d+)/\1 AGNO/;
+s/(unknown block state, ag )(\d+)(, block )(\d+)/\1AGNO\3AGBNO/;
        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, block AGBNO/d'
+}
+
 _filter_dd()
 {
        fgrep -v records        # lose records in/out lines
index b9f28915dcf5541111ea2750240a186943eab35b..17607d6d5dc1721bd8f9416edfcbd1ac8e615361 100755 (executable)
@@ -129,7 +129,7 @@ _check_scratch_fs
 # nuke the finobt root, repair will have to regenerate from the inobt
 _corrupt_finobt_root $SCRATCH_DEV
 
-_scratch_xfs_repair 2>&1 | _filter_repair
+_scratch_xfs_repair 2>&1 | _filter_repair_lostblocks
 
 status=0
 exit
index bc807753d5dd57b7522c17999810f817a978381d..fcea754474c587109dd8b46a62fe36080a971e58 100755 (executable)
@@ -58,7 +58,7 @@ _check_ag()
                            -e '/^bad agbno AGBNO for rmapbt/d' \
                            -e '/^bad agbno AGBNO for refcntbt/d' \
                            -e '/^Missing reverse-mapping record.*/d' \
-                           -e '/^unknown block state, ag 0, block.*/d'
+                           -e '/^unknown block state, ag AGNO, block.*/d'
        done
 }