[PATCH] xfstests: btrfs/015 regression test for prealloc with balance

Zach Brown zab at redhat.com
Fri Sep 27 12:55:59 CDT 2013


> +nr_csum_no_found=$(dmesg | grep -c "no csum found")
> +nr_csum_failed=$(dmesg | grep -c "csum failed")
> +
> +_check_csum_error()
> +{
> +	new_csum_no_found=$(dmesg | grep -c "no csum found")
> +	new_csum_failed=$(dmesg | grep -c "csum failed")
> +
> +	if [ $nr_csum_no_found -eq $new_csum_no_found -a \
> +	     $nr_csum_failed -eq $new_csum_failed ]; then
> +		return 0
> +	fi
> +	return 1
> +}

> +# This sucks but unfortunately it is the only way to be sure something didn't go
> +# wrong.
> +_check_csum_error || _fail "csum detected, please check dmesg"

In the future you could make them trace events and catch them for a
given invocation of a command with perf.

- z



More information about the xfs mailing list