[PATCH] xfstests: 298: fix failure on ext4 with bigalloc

From: Tomas Racek
Date: Tue Jun 18 2013 - 07:45:50 EST


Count with cluster size instead of block size if bigalloc is used.

Signed-off-by: Tomas Racek <tracek@xxxxxxxxxx>
---
tests/shared/298 | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tests/shared/298 b/tests/shared/298
index 4541798..78a229d 100755
--- a/tests/shared/298
+++ b/tests/shared/298
@@ -56,14 +56,21 @@ get_free_sectors()
{
case $FSTYP in
ext4)
+ cluster_size=$($DUMPE2FS_PROG $img_file 2>&1 | sed -n 's/Cluster size: *\(.*\)/\1/p')
+ if [ -n "$cluster_size" ]; then
+ blocks_per_cluster=`expr $cluster_size / $block_size`
+ else
+ blocks_per_cluster=1
+ fi
+
$DUMPE2FS_PROG $img_file 2>&1 | grep " Free blocks" | cut -d ":" -f2- | \
tr ',' '\n' | $SED_PROG 's/^ //' | \
- $AWK_PROG -v spb=$sectors_per_block 'BEGIN{FS="-"};
+ $AWK_PROG -v spb=$sectors_per_block -v bpc=$blocks_per_cluster 'BEGIN{FS="-"};
NF {
if($2 != "") # range of blocks
- print spb * $1, spb * ($2 + 1) - 1;
+ print spb * $1, spb * ($2 + bpc) - 1;
else # just single block
- print spb * $1, spb * ($1 + 1) - 1;
+ print spb * $1, spb * ($1 + bpc) - 1;
}'
;;
xfs)
--
1.7.11.7


>
> Tom can you take a look at this ? (Adding Tomas Racek to the CC)
>
> So, since this failure is not really related to the patch itself,
> can we re-include the patch (it might be already too late I guess).
>
> Thanks!
> -Lukas
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/