At 06/01/2016 03:51 AM, Mark Fasheh wrote:
Thanks for this test. On Tue, May 31, 2016 at 10:03:54AM +0800, Lu Fengqi wrote:+echo "Start balance" >>$seqres.full +_btrfs_stress_balance -d $SCRATCH_MNT >/dev/null 2>&1 & +balance_pid=$! + +# 30s is enough to trigger bug +sleep $((30*$TIME_FACTOR)) +kill $fsstress_pid $balance_pid +wait + +# kill _btrfs_stress_balance can't end balance, so call btrfs balance cancel +# to cancel running or paused balance. +$BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null + +rm -rf $SCRATCH_MNT/* +_run_btrfs_util_prog filesystem sync $SCRATCH_MNT +units=`_btrfs_qgroup_units` +$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $SED_PROG -n '/[0-9]/p' | \ + $AWK_PROG '{print $2" "$3}'Wouldn't it be better here to just have btrfsck check for inconsistencies? If you look at tests/btrfs/122 this is what I mean: +# generate a qgroup report and look for inconsistent groups +$BTRFS_UTIL_PROG check --qgroup-report $SCRATCH_DEV 2>&1 | \ + grep -q -E "Counts for qgroup.*are different" +if [ $? -ne 0 ]; then + status=0 +fi That way we're not keying on some specific value showing up but instead that qgroup validation passes (which is really what we want to test). Thanks, --Mark -- Mark Fasheh
OK, I will try this and update this patch. Thanks, Lu -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
