diff mbox series

[5/7] btrfs/023: skip trying to test raid56 without kernel support

Message ID 20190121163316.20616-5-jeffm@suse.com (mailing list archive)
State New, archived
Headers show
Series [1/7] btrfs/010: don't run without /sys/fs/btrfs | expand

Commit Message

Jeff Mahoney Jan. 21, 2019, 4:33 p.m. UTC
From: Jeff Mahoney <jeffm@suse.com>

Older kernels don't support raid56.  This test is still valid for
other profiles, so skip raid56 if the kernel doesn't support it.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 tests/btrfs/023 | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Filipe Manana Jan. 22, 2019, 10:40 p.m. UTC | #1
On Mon, Jan 21, 2019 at 4:33 PM <jeffm@suse.com> wrote:
>
> From: Jeff Mahoney <jeffm@suse.com>
>
> Older kernels don't support raid56.  This test is still valid for
> other profiles, so skip raid56 if the kernel doesn't support it.
>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Looks good. Since it's a btrfs specific change/fix, it would have been
a good idea to cc linux-btrfs.

> ---
>  tests/btrfs/023 | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/tests/btrfs/023 b/tests/btrfs/023
> index 6d9cc443..6c02113b 100755
> --- a/tests/btrfs/023
> +++ b/tests/btrfs/023
> @@ -63,11 +63,13 @@ check_group_profile "RAID1"
>  create_group_profile "raid10"
>  check_group_profile "RAID10"
>
> -create_group_profile "raid5"
> -check_group_profile "RAID5"
> +if [ -e "/sys/fs/btrfs/features/raid56" ]; then
> +       create_group_profile "raid5"
> +       check_group_profile "RAID5"
>
> -create_group_profile "raid6"
> -check_group_profile "RAID6"
> +       create_group_profile "raid6"
> +       check_group_profile "RAID6"
> +fi
>
>  # success, all done
>  echo "Silence is golden"
> --
> 2.16.4
>
diff mbox series

Patch

diff --git a/tests/btrfs/023 b/tests/btrfs/023
index 6d9cc443..6c02113b 100755
--- a/tests/btrfs/023
+++ b/tests/btrfs/023
@@ -63,11 +63,13 @@  check_group_profile "RAID1"
 create_group_profile "raid10"
 check_group_profile "RAID10"
 
-create_group_profile "raid5"
-check_group_profile "RAID5"
+if [ -e "/sys/fs/btrfs/features/raid56" ]; then
+	create_group_profile "raid5"
+	check_group_profile "RAID5"
 
-create_group_profile "raid6"
-check_group_profile "RAID6"
+	create_group_profile "raid6"
+	check_group_profile "RAID6"
+fi
 
 # success, all done
 echo "Silence is golden"