xfs/288: notrun if xfs_db write command fails
authorZorro Lang <zlang@redhat.com>
Fri, 10 Aug 2018 03:26:32 +0000 (11:26 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 12 Aug 2018 12:14:16 +0000 (20:14 +0800)
Old xfsprogs can't change attr hdr.count to 0 on v5 filesystems, two
reasons maybe cause this issue:

1) This commit has been merged: 89baf918(xfs_db: write values into
   dir/attr blocks and recalculate CRCs).
2) xfs_db write command doesn't support -d option.

That's not a real bug, so skip this test if xfs_db can't set attr
hdr.count to 0.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/288

index f4165b6c97cbb8fe0de1b5d20cb34c960198ef69..c68219092d5108baa5b9315bbc367c400d50ddbe 100755 (executable)
@@ -59,6 +59,14 @@ _scratch_unmount
 _scratch_xfs_set_metadata_field "hdr.count" "0" \
                                "inode $inum" "ablock 0" >> $seqres.full
 
+# verify current xfs_db write command can set hdr.count to 0. Old xfsprogs
+# can't do that on v5 filesystems.
+count=$(_scratch_xfs_get_metadata_field "hdr.count" \
+                                       "inode $inum" "ablock 0")
+if [ "$count" != "0" ]; then
+       _notrun "xfs_db can't set attr hdr.count to 0"
+fi
+
 # make sure xfs_repair can find above corruption. If it can't, that
 # means we need to fix this bug on current xfs_repair
 _scratch_xfs_repair -n >> $seqres.full 2>&1