* [PATCH] btrfs: fix computation of max fs size for multiple device fs tests
@ 2018-11-06 15:34 fdmanana
2018-11-13 10:27 ` Anand Jain
0 siblings, 1 reply; 2+ messages in thread
From: fdmanana @ 2018-11-06 15:34 UTC (permalink / raw)
To: fstests; +Cc: linux-btrfs, Filipe Manana
From: Filipe Manana <fdmanana@suse.com>
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>
---
tests/btrfs/124 | 2 +-
tests/btrfs/125 | 2 +-
tests/btrfs/154 | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/btrfs/124 b/tests/btrfs/124
index ce3ad6aa..a52c65f6 100755
--- a/tests/btrfs/124
+++ b/tests/btrfs/124
@@ -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
diff --git a/tests/btrfs/125 b/tests/btrfs/125
index e38de264..5ac68b67 100755
--- a/tests/btrfs/125
+++ b/tests/btrfs/125
@@ -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
diff --git a/tests/btrfs/154 b/tests/btrfs/154
index 99ea232a..cd6c688f 100755
--- a/tests/btrfs/154
+++ b/tests/btrfs/154
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] btrfs: fix computation of max fs size for multiple device fs tests
2018-11-06 15:34 [PATCH] btrfs: fix computation of max fs size for multiple device fs tests fdmanana
@ 2018-11-13 10:27 ` Anand Jain
0 siblings, 0 replies; 2+ messages in thread
From: Anand Jain @ 2018-11-13 10:27 UTC (permalink / raw)
To: fdmanana, fstests; +Cc: linux-btrfs, Filipe Manana
On 11/06/2018 11:34 PM, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> 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>
Thanks for the fix.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
> ---
> tests/btrfs/124 | 2 +-
> tests/btrfs/125 | 2 +-
> tests/btrfs/154 | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/btrfs/124 b/tests/btrfs/124
> index ce3ad6aa..a52c65f6 100755
> --- a/tests/btrfs/124
> +++ b/tests/btrfs/124
> @@ -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
> diff --git a/tests/btrfs/125 b/tests/btrfs/125
> index e38de264..5ac68b67 100755
> --- a/tests/btrfs/125
> +++ b/tests/btrfs/125
> @@ -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
> diff --git a/tests/btrfs/154 b/tests/btrfs/154
> index 99ea232a..cd6c688f 100755
> --- a/tests/btrfs/154
> +++ b/tests/btrfs/154
> @@ -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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-13 10:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-06 15:34 [PATCH] btrfs: fix computation of max fs size for multiple device fs tests fdmanana
2018-11-13 10:27 ` Anand Jain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).