btrfs/004: fix to make test really work

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>
This commit is contained in:
Wang Shilong
2014-02-18 21:18:16 +11:00
committed by Dave Chinner
parent b985883b2c
commit 617252fc09
+11 -5
View File
@@ -57,11 +57,17 @@ _require_command "/usr/sbin/filefrag"
rm -f $seqres.full rm -f $seqres.full
FILEFRAG_FILTER='if (/, blocksize (\d+)/) {$blocksize = $1; next} ($ext, '\ FILEFRAG_FILTER='
'$logical, $physical, $expected, $length, $flags) = (/^\s*(\d+)\s+(\d+)'\ if (/blocks of (\d+) bytes/) {
'\s+(\d+)\s+(?:(\d+)\s+)?(\d+)\s+(.*)/) or next; $flags =~ '\ $blocksize = $1;
'/(?:^|,)inline(?:,|$)/ and next; print $physical * $blocksize, "#", '\ next
'$length * $blocksize, "#", $logical * $blocksize, " "' }
($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. # this makes filefrag output script readable by using a perl helper.
# output is one extent per line, with three numbers separated by '#' # output is one extent per line, with three numbers separated by '#'