generic: test deadlock on O_DIRECT|O_DSYNC
[xfstests-dev.git] / tests / btrfs / 154
index 99ea232aba4c8d922f4526ce68c9a13fe64fdc1f..321bbee9909915237f772f10ea0f61012c63b601 100755 (executable)
@@ -36,7 +36,7 @@ rm -f $seqres.full
 _supported_fs btrfs
 _supported_os Linux
 _require_scratch_dev_pool 2
-_require_loadable_fs_module "btrfs"
+_require_btrfs_forget_or_module_loadable
 
 _scratch_dev_pool_get 2
 
@@ -51,7 +51,7 @@ DEV1_SZ=`blockdev --getsize64 $DEV1`
 DEV2_SZ=`blockdev --getsize64 $DEV2`
 
 # get min
-MAX_FS_SZ=`echo -e "$DEV1_SZ\n$DEV2_SZ" | sort | head -1`
+MAX_FS_SZ=`echo -e "$DEV1_SZ\n$DEV2_SZ" | sort -n | head -1`
 # Need disks with more than 2G
 if [ $MAX_FS_SZ -lt 2000000000 ]; then
        _scratch_dev_pool_put
@@ -90,7 +90,7 @@ degrade_mount_write()
 
        echo "clean btrfs ko" >> $seqres.full
        # un-scan the btrfs devices
-       _reload_fs_module "btrfs"
+       _btrfs_forget_or_module_reload
        _mount -o degraded $DEV1 $SCRATCH_MNT >>$seqres.full 2>&1
        cnt=$(( $COUNT/10 ))
        dd if=/dev/urandom of="$SCRATCH_MNT"/tf1 bs=$bs count=$cnt \
@@ -129,8 +129,8 @@ balance_convert()
        echo
        echo "run balance"
 
-       _run_btrfs_util_prog balance start --full-balance -dconvert=raid1 \
-                               -mconvert=raid1 ${SCRATCH_MNT}
+       _run_btrfs_balance_start -dconvert=raid1 \
+                                -mconvert=raid1 $SCRATCH_MNT >> $seqres.full
 }
 
 verify()
@@ -142,7 +142,7 @@ verify()
        echo "unmount" >> $seqres.full
 
        _scratch_unmount
-       _reload_fs_module "btrfs"
+       _btrfs_forget_or_module_reload
        _mount -o degraded $DEV2 $SCRATCH_MNT >>$seqres.full 2>&1
        verify_checkpoint1=`md5sum $SCRATCH_MNT/tf1`
        verify_checkpoint2=`md5sum $SCRATCH_MNT/tf2`