On Thu, Aug 28, 2014 at 09:47:43PM +0800, Eryu Guan wrote:
> Run btrfs balance and scrub operations simultaneously with fsstress
> running in background.
> +run_test()
> +{
> +     local mkfs_opts=$1
> +
> +     echo "Test $mkfs_opts" >>$seqres.full
> +
> +     # dup only works on single device
> +     if [[ "$mkfs_opts" =~ dup ]]; then
> +             _scratch_mkfs $mkfs_opts >>$seqres.full 2>&1
> +     else
> +             _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
> +     fi
> +     # make sure we created btrfs with desired options
> +     if [ $? -ne 0 ]; then
> +             echo "mkfs $mkfs_opts failed"
> +             return
> +     fi
> +     _scratch_mount >>$seqres.full 2>&1

This mkfs/mount code is repeated in all of the first three tests.
Factor, please.

> +     $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT >/dev/null 2>&1
> +     _scratch_unmount
> +     _check_scratch_fs

And why, exactly do we need a special btrfs "sync" before unmount?
THose three lines should be just one: _check_scratch_fs

If the test actually requires a special btrfs hack before unmount,
add a comment explaining why that hack is necessary....

Cheers,

Dave.
-- 
Dave Chinner
da...@fromorbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to