From patchwork Fri Apr 5 19:56:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13619369 Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4B8217334B for ; Fri, 5 Apr 2024 19:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346987; cv=none; b=u+CCxMfOU21W5PkP5p7ui+CwGEUmbSmrX5bytNQIVB7nLV+vTccWzQoLx5JmzgUHZvxZXcVgEcg++fSlsC3oQAs3J9d1dwqbtvULsTcDTF7C1ultVk95zQ/l9Zhihh+1HEE9Esfhyqy4uBEAGQgSZ7XNEyaDWFtkA/sKy3JSH3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346987; c=relaxed/simple; bh=f7n9wQyvNkyfre4dBDX+1wJDTsB+exwyeh1Cu5coEfk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EUyRy28J4P1QKg77LZW8nY4U2PYGaBB+2YDbAymcZ4i2l+siqzZ7WxmT50SBsHdD7ggyLmjhoTFUK/ekxn5gjOR7k77SlIItWQto5jyQMhaa3Rv8dRUlslBp4wwKSWgA2yC6M29NL3Pxw+s0tpV5byhmQKTiE1lzXtmCA/9Fw7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com; spf=none smtp.mailfrom=toxicpanda.com; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b=R5+rgcOX; arc=none smtp.client-ip=209.85.128.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b="R5+rgcOX" Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-617cd7bd929so11840877b3.3 for ; Fri, 05 Apr 2024 12:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1712346984; x=1712951784; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8jAQhTkshKgHWtfiyScKAvltEzvkerS8QAtp+/c9zro=; b=R5+rgcOXxgl5Aog2REqlDfWiynn08q/QW+O6Bs0QczTidM1O+YgWpunNvKepYyuftx 0ABwtsE8yWnnGkIEly80lzi6lWj9h3sHL7cIxsy5+tQMvHdkbWv4FcF9kgFT2DOvTmd9 ETlMEHx5rYKUUxSStv1iPMQw88y74Pvt6nSar9u0g4whdw91r4hiBoIYm3fBlHfdmBLo cdXWO+G8sdAXfqvTA+Lc6L2mT8IulwMk26h+BWRo3RlVpxphPZ2bQ4Laj4sA3u6JaZ02 ihE4S+HJT/CD+lTuLcGSESRDEii7CUauFprwpDSmA7+bl7Hucxvjt5GJgNYKtSx+AvEH r2RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712346984; x=1712951784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8jAQhTkshKgHWtfiyScKAvltEzvkerS8QAtp+/c9zro=; b=QeYAM9K0UVvcl6khSfpjn9cqfCHgls/wSpgAIB25mFNuZUwFhxmsIAceVyFNToSXp7 98D5rVoTRB/j9Sa8YoYGz3qbVrQ+040wD1S+F9R3LMxa7iVCON6iiHFT8t7+czo6fb76 2RKYEiaqBVF93jHdqQZE4sf4xswTQq1LjR5s7+0iR1d4zMCjAUSJP4Kicl18VFnkQWB/ B6BmfoYW3Fshegb7CWV45BvO2/hf9R7vQj2N+XHa6ZikTGuxIJk/8SXJqWuCL4Cfa+zV gJIDWPwjyRgj2Emjxh4abv2elIb+KKsOXbUsjUE44tBUVTWEyJE1OtjwGFrH02QjOEbP a2tQ== X-Gm-Message-State: AOJu0Yx2W9gfzkbtIH/Rtyg+HLjEs82TrVQbyLCH4VURebPtKpl6YSUU prbkzlrV7Tppmta1Zn+h7wioodtYGAxIMKpqvYrEdf0qaIuAvqK5w7l1mUI9v9Z2pSYzCeXdydO o X-Google-Smtp-Source: AGHT+IHlxvNbcraq11Ixwrgn9+7FOq4UV97HdVb/zuWGIY6ttwfEZ/vmoA47sHnSaW2/GqaMsDY1CQ== X-Received: by 2002:a0d:d554:0:b0:615:800d:67b2 with SMTP id x81-20020a0dd554000000b00615800d67b2mr2246292ywd.29.1712346984422; Fri, 05 Apr 2024 12:56:24 -0700 (PDT) Received: from localhost (076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id fb17-20020a05622a481100b00434383f2518sm1049910qtb.87.2024.04.05.12.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:56:23 -0700 (PDT) From: Josef Bacik To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v2 1/3] fstests: change btrfs/197 and btrfs/198 golden output Date: Fri, 5 Apr 2024 15:56:12 -0400 Message-ID: <88b11129c00fb9b07e36569b4b5fe823c0a98c39.1712346845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Both btrfs/197 and btrfs/198 check several raid types. We may not have support for raid5/6 for our available profiles, but we'd like to be able to test the other profiles. In order to enable this, update the golden output to have no output, and simply have the test check for the device we removed to see if it still exists in the device list output. This will allow us to add a check to skip unsupported raid configurations in our config. Signed-off-by: Josef Bacik Reviewed-by: Anand Jain --- tests/btrfs/197 | 7 +++++-- tests/btrfs/197.out | 25 +------------------------ tests/btrfs/198 | 7 +++++-- tests/btrfs/198.out | 25 +------------------------ 4 files changed, 12 insertions(+), 52 deletions(-) diff --git a/tests/btrfs/197 b/tests/btrfs/197 index d259fd99..2ce41b32 100755 --- a/tests/btrfs/197 +++ b/tests/btrfs/197 @@ -38,7 +38,7 @@ workout() raid=$1 device_nr=$2 - echo $raid + echo $raid >> $seqres.full _scratch_dev_pool_get $device_nr _spare_dev_get @@ -62,7 +62,9 @@ workout() _mount -o degraded $device_2 $SCRATCH_MNT # Check if missing device is reported as in the .out $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \ - _filter_btrfs_filesystem_show + _filter_btrfs_filesystem_show > $tmp.output 2>&1 + cat $tmp.output >> $seqres.full + grep -q "$device_1" $tmp.output && _fail "found stale device" $BTRFS_UTIL_PROG device remove "$device_1" "$TEST_DIR/$seq.mnt" $UMOUNT_PROG $TEST_DIR/$seq.mnt @@ -77,5 +79,6 @@ workout "raid6" "4" workout "raid10" "4" # success, all done +echo "Silence is golden" status=0 exit diff --git a/tests/btrfs/197.out b/tests/btrfs/197.out index 79237b85..3bbd3143 100644 --- a/tests/btrfs/197.out +++ b/tests/btrfs/197.out @@ -1,25 +1,2 @@ QA output created by 197 -raid1 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid5 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid6 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid10 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - +Silence is golden diff --git a/tests/btrfs/198 b/tests/btrfs/198 index 7d23ffce..a326a8ca 100755 --- a/tests/btrfs/198 +++ b/tests/btrfs/198 @@ -28,7 +28,7 @@ workout() raid=$1 device_nr=$2 - echo $raid + echo $raid >> $seqres.full _scratch_dev_pool_get $device_nr _scratch_pool_mkfs "-d$raid -m$raid" >> $seqres.full 2>&1 || \ @@ -46,7 +46,9 @@ workout() _mount -o degraded $device_2 $SCRATCH_MNT # Check if missing device is reported as in the 196.out $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \ - _filter_btrfs_filesystem_show + _filter_btrfs_filesystem_show > $tmp.output 2>&1 + cat $tmp.output >> $seqres.full + grep -q "$device_1" $tmp.output && _fail "found stale device" _scratch_unmount _scratch_dev_pool_put @@ -58,5 +60,6 @@ workout "raid6" "4" workout "raid10" "4" # success, all done +echo "Silence is golden" status=0 exit diff --git a/tests/btrfs/198.out b/tests/btrfs/198.out index af904a39..cb4c7854 100644 --- a/tests/btrfs/198.out +++ b/tests/btrfs/198.out @@ -1,25 +1,2 @@ QA output created by 198 -raid1 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid5 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid6 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid10 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - +Silence is golden From patchwork Fri Apr 5 19:56:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13619370 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1902F17335D for ; Fri, 5 Apr 2024 19:56:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346988; cv=none; b=nJahVdH14gTKQbXeQmhAfIySAb5Dy5AMYJmZf96AiT2d4zpiKIHOPAiP2vVaVZp4HvvRBvilguS8pFUnxdh9ViiDUoIzwUEEgV118USsqXaHVwC9J3cbG0crQPVES77Lk3N06wtyYb9/EjavjAblXC5LPH1bu71E3UvcqyKAgzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346988; c=relaxed/simple; bh=HYUW+z//x5mv5zjQLHy4xGBk1J7vq2b4pb+HyyJmcIo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bmMYKS8iSN0I48DsdbCXVoTVu1h+KICh+3SNQfRQTigjBUDKSA2F5JqqFeQxs2EofmZ90crw9P5VMSnk1Z8DMmTRi3r88FGeHzNi22azCTthGoi07kuXgQu7utb2b8lH7kuXvsf+tTxp+ynGh5WIrrHnWOvlTILs2dI7Qw2Wg4s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com; spf=none smtp.mailfrom=toxicpanda.com; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b=gd/TQ7Yo; arc=none smtp.client-ip=209.85.160.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b="gd/TQ7Yo" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-430a25ed4e7so14388031cf.0 for ; Fri, 05 Apr 2024 12:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1712346986; x=1712951786; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=YuucR5tQ+uVPIm11Y7vgLKHErtjkCXmOFvH2OaG8/wM=; b=gd/TQ7YovO86gecjqQCM8nLLndKJo9f+8FSrJMskKew0GYIWltP5igHfb1olaJR9bw kIflbhQ/UmoX4UaUm8eEug+zkACGoHxAmTXzLWdb7oPpMl5bT6mytHsZRY7JnKtegTHt xVevIg4ddJJFuSZ9/QgtWh4TeYNLNISaBa3E1IUy9rnChFAdwUOm/bw2oVufCL6hh5em BHatAhEJ6aoyix3PEuLOKGPCvaXW1+VRF89dL5z7oSRXI/PIhRVF9b4KgZy+X/6v/PJo o0HlryTlY/QAtC6fPpNgDB/oj4DA84MHweSz5Dy5Gna5A8U46VenxnFKqng1Fuz1Tl5G Joeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712346986; x=1712951786; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YuucR5tQ+uVPIm11Y7vgLKHErtjkCXmOFvH2OaG8/wM=; b=J+JFFmDIfJEYdSqFcqJhGUeDDut81oun3y34BDMoFkoyU0dfAjQcfv/0IjTsTue/NV dMS7CGy7cngDk0+8f2FvHis5yWO7VjmLOFUNQ/xy4QGq1l++ouy4ACLS3uJaYKdk2jUG 9jmo0b7EfqB4hXkC/KfQcGjcEmo1rIfMwlIGoj9r7yCEVSZAExcNr1AZfiD4ceAx60zS QA4DZejkhh409PbvE7DixIrfMxYNrXzztQldCxuQnVVN+874W4Seqs3jEAudIroFrAZP Nwc9eiOjs0KxcTKd0ZKTCMGOfkf2JzOdiZyuOTNA+EVNxZeJKMeF8Bk66LUxZoli5XUn 7CUw== X-Gm-Message-State: AOJu0Yzzi3HIRHH2GVr/6aCpGWeEuUQEdPjADl+2vOqKrt0Hti2ZDkoM q8gghjUN7Kkuk9nXMbtgtGAT1zfLiMZ4EKOXcqQ8YYuHmk4cwQ8LgvJrtL7saF088v42cTRPWV/ A X-Google-Smtp-Source: AGHT+IEA7M+xKsCKiADYz/4Mi1mQQPa7Fbz8fuenzFobxaGYdovn4Bpb6fC2H0wihjc+UTxGuJ0HnQ== X-Received: by 2002:ac8:574f:0:b0:434:4a16:609c with SMTP id 15-20020ac8574f000000b004344a16609cmr2324082qtx.39.1712346985929; Fri, 05 Apr 2024 12:56:25 -0700 (PDT) Received: from localhost (076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id er7-20020a05622a5e8700b004317485a4e9sm1042020qtb.66.2024.04.05.12.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:56:25 -0700 (PDT) From: Josef Bacik To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v2 2/3] fstests: change how we test for supported raid configs Date: Fri, 5 Apr 2024 15:56:13 -0400 Message-ID: <86703e27bdb8c49950be6ea65ac228ece3ecc315.1712346845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In btrfs there's a few ways we limit the RAID profiles we'll use. We have the raid56 feature that can be compiled out, zoned devices don't support certain raid configurations, and you can manually set BTRFS_PROFILE_CONFIGS to limit what you're testing. To handle all of these different scenarios in the same way, update _btrfs_get_profile_configs() to check for RAID56 support and remove it if it is not there, and then add _require_btrfs_raid_type and _check_btrfs_raid_type to get all the settings and then check if the requested raid type is available. From there I've updated all of the existing tests that use _require_btrfs_fs_feature raid56 to use _require_btrfs_raid_type where appropriate. Signed-off-by: Josef Bacik Reviewed-by: Anand Jain --- common/btrfs | 29 ++++++++++++++++++++++++----- tests/btrfs/125 | 2 +- tests/btrfs/148 | 3 ++- tests/btrfs/157 | 2 +- tests/btrfs/158 | 2 +- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/common/btrfs b/common/btrfs index e1b29c61..845d01ea 100644 --- a/common/btrfs +++ b/common/btrfs @@ -98,11 +98,6 @@ _require_btrfs_fs_feature() modprobe btrfs > /dev/null 2>&1 [ -e /sys/fs/btrfs/features/$feat ] || \ _notrun "Feature $feat not supported by the available btrfs version" - - if [ $feat = "raid56" ]; then - # Zoned btrfs only supports SINGLE profile - _require_non_zoned_device "${SCRATCH_DEV}" - fi } _require_btrfs_fs_sysfs() @@ -218,6 +213,8 @@ _btrfs_get_profile_configs() return fi + modprobe btrfs > /dev/null 2>&1 + local unsupported=() if [ "$1" == "replace" ]; then # We can't do replace with these profiles because they @@ -237,6 +234,14 @@ _btrfs_get_profile_configs() ) fi + if [ ! -e /sys/fs/btrfs/features/raid56 ]; then + # We don't have raid56 compiled in, remove them + unsupported+=( + "raid5" + "raid6" + ) + fi + if _scratch_btrfs_is_zoned; then # Zoned btrfs only supports SINGLE profile unsupported+=( @@ -792,3 +797,17 @@ _has_btrfs_sysfs_feature_attr() test -e /sys/fs/btrfs/features/$feature_attr } + +_check_btrfs_raid_type() +{ + _btrfs_get_profile_configs + if [[ ! "${_btrfs_profile_configs[@]}" =~ "$1" ]]; then + return 1 + fi + return 0 +} + +_require_btrfs_raid_type() +{ + _check_btrfs_raid_type $1 || _notrun "$1 isn't supported by the profile config" +} diff --git a/tests/btrfs/125 b/tests/btrfs/125 index 1b6e5d78..d957c139 100755 --- a/tests/btrfs/125 +++ b/tests/btrfs/125 @@ -41,7 +41,7 @@ _supported_fs btrfs _require_scratch_dev_pool 3 _test_unmount _require_btrfs_forget_or_module_loadable -_require_btrfs_fs_feature raid56 +_require_btrfs_raid_type raid5 _scratch_dev_pool_get 3 diff --git a/tests/btrfs/148 b/tests/btrfs/148 index 65a26292..9bbcd8e9 100755 --- a/tests/btrfs/148 +++ b/tests/btrfs/148 @@ -17,7 +17,8 @@ _supported_fs btrfs _require_scratch _require_scratch_dev_pool 4 _require_odirect -_require_btrfs_fs_feature raid56 +_require_btrfs_raid_type raid5 +_require_btrfs_raid_type raid6 _scratch_dev_pool_get 4 diff --git a/tests/btrfs/157 b/tests/btrfs/157 index 022db511..8441a786 100755 --- a/tests/btrfs/157 +++ b/tests/btrfs/157 @@ -32,7 +32,7 @@ _begin_fstest auto quick raid read_repair _supported_fs btrfs _require_scratch_dev_pool 4 _require_btrfs_command inspect-internal dump-tree -_require_btrfs_fs_feature raid56 +_require_btrfs_raid_type raid6 get_physical() { diff --git a/tests/btrfs/158 b/tests/btrfs/158 index aa85835a..cd4f604c 100755 --- a/tests/btrfs/158 +++ b/tests/btrfs/158 @@ -24,7 +24,7 @@ _begin_fstest auto quick raid scrub _supported_fs btrfs _require_scratch_dev_pool 4 _require_btrfs_command inspect-internal dump-tree -_require_btrfs_fs_feature raid56 +_require_btrfs_raid_type raid5 get_physical() { From patchwork Fri Apr 5 19:56:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13619371 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC819174ECA for ; Fri, 5 Apr 2024 19:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346990; cv=none; b=nypcXHy9lEfFxK8c2DVNRJTYeLXRVa8qsIiH1RZdf18gwvC/MAmmOpm9AxVjyDCAWG2TsrsvLuVgp2EyjVhCuUlE6rVK0MQGir17wkene0b4rzGkGSyGtUlr494mJO7/bdOFWx9DM+sQTxUAm5UrNHuRhl+h/CleHLy/Clw54DU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346990; c=relaxed/simple; bh=aPbMiZOwI+NGFueUpLxHWqQ6gUxj9pl36zsDIuOZjOE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GA8AKfA4tnRC/MUN2rJkpuC+0lNS+P9ttMfNLyQ9KZI8S1kukekaDIC4GbT+GWEOnOHlh1ZBWG6SF4J9fD2Z/w93X3lnJj4wVmx8IRWI5j071s4SvjEpYg0m2Ndv/xF+50AKne3WRUiIJ3RFMfWSpwTuW7XOVr4CC06Bzq8Wbos= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com; spf=none smtp.mailfrom=toxicpanda.com; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b=MNpfhgeT; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b="MNpfhgeT" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6994313546aso3914606d6.2 for ; Fri, 05 Apr 2024 12:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1712346988; x=1712951788; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zBF7VbLO1AdTYvcpdTi26pAOfpXqNacAoJuOltaVhbM=; b=MNpfhgeTB1/g+rul08kjEX6s+f4dUhl2Q46Qzjq2U7fxbTnwMZcWTj2PkE1T4DbuRW HezO5Koa17ewyu56fmVqRGjNcJMk2AOwFSzMikKrEk/KLrFAul6Kj0WTpj6sD03QtngO 7cIae5uYtNdWOc6aTq+bc4Bhtr5IhMnifAlciY5Dx0ys0M7RxOAFylO4cojxH0w4P3+M bnPaDvVf+/7v34MI5YyUOQ0UEyjz+VV77fAPHgZFJGCwjaCDwwHgvXAxxAHZdftpTqK/ RyC02ZupWrHyCAc97e4KJbq2pQ4JOq66YVf68z3aNv48xI+qIF1Av7X5i3pTVl9Jr03Z /wAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712346988; x=1712951788; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zBF7VbLO1AdTYvcpdTi26pAOfpXqNacAoJuOltaVhbM=; b=kepytTStC+gTDPoc+0xyIViE25UAxzd+eK7RsnHt3WRExr145vvJkZYH69X6aNBaBa Wmo6C8sTMlPQWwfeUL3dMwYRhObdCjsJ3wrs4jBIKolme6TM9NtpALxLOce5bMaxyOdv GNEtIRuLlemNCe0sKCLEjPnyfdazxH+RPjn1y0UKZasrkQMWal3/K1b3aB7P9ZV3y7oM zYDbMDPOvKQfeB5BDxWDaLGcvhJRssDh/6i3e68wfUiyaD01DGlzViywjiRkNS+XeU5+ UA9U1gXTnozYlssHQNhI5KjvEoQbCEK2r+tCse7MNwBbVBxkxZznclCSmTOiQaj4e0ov A2rA== X-Gm-Message-State: AOJu0YzY003eAtpi8lRfHVm1HAI4ALyr8q9toXORw/NLd+EADokYRwPy e9QYNKOIJWgI0lixRCN/MmW6oQ3MD6Yn3sXBc/fNIAG4m4Xm3nol35odA7K18NTmTPwIAqHv95e X X-Google-Smtp-Source: AGHT+IFxrZf584DI1C/A2wc+WeyJwP9UAfKJp/q2R1/IghLX6g5qayzXZseqwvI/TbiooPIjePreRw== X-Received: by 2002:a05:6214:c6b:b0:699:322a:e54f with SMTP id t11-20020a0562140c6b00b00699322ae54fmr1819839qvj.59.1712346987229; Fri, 05 Apr 2024 12:56:27 -0700 (PDT) Received: from localhost (076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id mx9-20020a0562142e0900b00699b99cc0ffsm24774qvb.25.2024.04.05.12.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:56:26 -0700 (PDT) From: Josef Bacik To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v2 3/3] fstests: update tests to skip unsupported raid profile types Date: Fri, 5 Apr 2024 15:56:14 -0400 Message-ID: <7111bf50942e0b72a43ceed010d8bab00c712a75.1712346845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Tests btrfs/197, btrfs/198, and btrfs/297 test multiple raid types in their workout() function. We may not support some of the raid types, so add a check in the workout() function to skip any incompatible raid profiles. Signed-off-by: Josef Bacik Reviewed-by: Anand Jain --- tests/btrfs/197 | 10 ++++++++-- tests/btrfs/198 | 10 ++++++++-- tests/btrfs/297 | 10 ++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/btrfs/197 b/tests/btrfs/197 index 2ce41b32..9ec4e9f0 100755 --- a/tests/btrfs/197 +++ b/tests/btrfs/197 @@ -30,14 +30,20 @@ _supported_fs btrfs _require_test _require_scratch _require_scratch_dev_pool 5 -# Zoned btrfs only supports SINGLE profile -_require_non_zoned_device ${SCRATCH_DEV} +# We require at least one raid setup, raid1 is the easiest, use this to gate on +# wether or not we run this test +_require_btrfs_raid_type raid1 workout() { raid=$1 device_nr=$2 + if ! _check_btrfs_raid_type $raid; then + echo "$raid isn't supported, skipping" >> $seqres.full + return + fi + echo $raid >> $seqres.full _scratch_dev_pool_get $device_nr _spare_dev_get diff --git a/tests/btrfs/198 b/tests/btrfs/198 index a326a8ca..c5a8f392 100755 --- a/tests/btrfs/198 +++ b/tests/btrfs/198 @@ -18,8 +18,9 @@ _supported_fs btrfs _require_command "$WIPEFS_PROG" wipefs _require_scratch _require_scratch_dev_pool 4 -# Zoned btrfs only supports SINGLE profile -_require_non_zoned_device ${SCRATCH_DEV} +# We require at least one raid setup, raid1 is the easiest, use this to gate on +# wether or not we run this test +_require_btrfs_raid_type raid1 _fixed_by_kernel_commit 96c2e067ed3e3e \ "btrfs: skip devices without magic signature when mounting" @@ -28,6 +29,11 @@ workout() raid=$1 device_nr=$2 + if ! _check_btrfs_raid_type $raid; then + echo "$raid isn't supported, skipping" >> $seqres.full + return + fi + echo $raid >> $seqres.full _scratch_dev_pool_get $device_nr diff --git a/tests/btrfs/297 b/tests/btrfs/297 index a0023861..7afe854d 100755 --- a/tests/btrfs/297 +++ b/tests/btrfs/297 @@ -18,11 +18,21 @@ _require_scratch_dev_pool 3 _fixed_by_kernel_commit 486c737f7fdc \ "btrfs: raid56: always verify the P/Q contents for scrub" +# If neither raid5 or raid6 are supported do _notrun +if ! _check_btrfs_raid_type raid5 && ! _check_btrfs_raid_type raid6; then + _notrun "requires either raid5 or raid6 support" +fi + workload() { local profile=$1 local nr_devs=$2 + if ! _check_btrfs_raid_type $profile; then + echo "$profile isn't supported, skipping" >> $seqres.full + return + fi + echo "=== Testing $nr_devs devices $profile ===" >> $seqres.full _scratch_dev_pool_get $nr_devs