]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs/004: fix to make test really work
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Tue, 18 Feb 2014 10:18:16 +0000 (21:18 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 18 Feb 2014 10:18:16 +0000 (21:18 +1100)
So I was wondering why test 004 could pass my previous wrong
kernel patch while it defenitely should not.

By some debugging, i found here perl script is wrong, we did not
filter out anything and this unit test did not work acutally.so
it came out we will never fail this test.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/btrfs/004

index 14da9f1a33f6d948d6bef4c8e3a133bcac855de2..1d608dbc4e86f9cda2daeeea56a886e846ce0840 100755 (executable)
@@ -57,11 +57,17 @@ _require_command "/usr/sbin/filefrag"
 
 rm -f $seqres.full
 
-FILEFRAG_FILTER='if (/, blocksize (\d+)/) {$blocksize = $1; next} ($ext, '\
-'$logical, $physical, $expected, $length, $flags) = (/^\s*(\d+)\s+(\d+)'\
-'\s+(\d+)\s+(?:(\d+)\s+)?(\d+)\s+(.*)/) or next; $flags =~ '\
-'/(?:^|,)inline(?:,|$)/ and next; print $physical * $blocksize, "#", '\
-'$length * $blocksize, "#", $logical * $blocksize, " "'
+FILEFRAG_FILTER='
+       if (/blocks of (\d+) bytes/) {
+               $blocksize = $1;
+               next
+       }
+       ($ext, $logical, $physical, $length) =
+               (/^\s*(\d+):\s+(\d+)..\s+\d+:\s+(\d+)..\s+\d+:\s+(\d+):/)
+       or next;
+       print $physical * $blocksize, "#",
+             $length * $blocksize, "#",
+             $logical * $blocksize, " "'
 
 # this makes filefrag output script readable by using a perl helper.
 # output is one extent per line, with three numbers separated by '#'