]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs: fix computation of max fs size for multiple device fs tests
authorFilipe Manana <fdmanana@suse.com>
Tue, 6 Nov 2018 15:34:37 +0000 (15:34 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 11 Nov 2018 14:20:09 +0000 (22:20 +0800)
We were sorting numerical values with the 'sort' tool without telling it
that we are sorting numbers, giving us unexpected ordering. So just pass
the '-n' option to the 'sort' tool.

Example:

$ echo -e "11\n9\n20" | sort
11
20
9

$ echo -e "11\n9\n20" | sort -n
9
11
20

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/124
tests/btrfs/125
tests/btrfs/154

index ce3ad6aa3a5895a86e2ce6590946c5f75b2ed3f4..a52c65f608ffd856e5baad273f0741f1b185ac6e 100755 (executable)
@@ -61,7 +61,7 @@ dev2=`echo $SCRATCH_DEV_POOL | awk '{print $2}'`
 dev1_sz=`blockdev --getsize64 $dev1`
 dev2_sz=`blockdev --getsize64 $dev2`
 # get min of both
-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
index e38de264b28e6a4a458d4a1809e2162bfa5e97f3..5ac68b6778f6dbf075ba9d0bebb9f5829cfe8aa3 100755 (executable)
@@ -68,7 +68,7 @@ dev2_sz=`blockdev --getsize64 $dev2`
 dev3_sz=`blockdev --getsize64 $dev3`
 
 # get min of both.
-max_fs_sz=`echo -e "$dev1_sz\n$dev2_sz\n$dev3_sz" | sort | head -1`
+max_fs_sz=`echo -e "$dev1_sz\n$dev2_sz\n$dev3_sz" | sort -n | head -1`
 # Need disks with more than 2G
 if [ $max_fs_sz -lt 2000000000 ]; then
        _scratch_dev_pool_put
index 99ea232aba4c8d922f4526ce68c9a13fe64fdc1f..cd6c688fb9fe99adc2580f0c06e2e0de1e196f51 100755 (executable)
@@ -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