From patchwork Thu Jun 13 00:23:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13695701 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 6AEE44C6B for ; Thu, 13 Jun 2024 00:23:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238234; cv=none; b=oTQysP7PI1Qh4AZuD8XpItGEo81pApLvI4a6OK4lGFdC7/9ctIj0wqlQF457OgmzzFWbggsqXHQ/axg22XdtgA2DIjvEQFT7gxcWJMnv6d7Y7rZk59otZO/1yAagY/NFHSU/wgeumi45GHhhBWYte82crm372U8AT0Fzrlh7g80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238234; c=relaxed/simple; bh=buF6jFoxf+MlSdtGbdonIrR9tbjgDK5vIgjiIFQptgc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kt7jV7EBSeMCTPu2YYOab/DPyS4xy8esg6wCW20GhPjCGkuvXxMoCfQxc+LVlDbODcsoTJiP3h2fGyboybuFiLeK2kgOdlXBvSi7bp+3dxULL4r0DLM1HOKISqJtZOkwh2+p6+uXycPrjS3cig7jtxx7gy9uxHccYwwSIcTR4I4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=cd22YuAF; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=cd22YuAF; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="cd22YuAF"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="cd22YuAF" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 82CC734B7F for ; Thu, 13 Jun 2024 00:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718238230; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dCT5E8awkjyh4X+jBIyuiArcOsYyb0Z5JPh6puWXozk=; b=cd22YuAFsQwfGZHoihTiLQqc+qPMipTVX8knoCEybwL64afTM3MlB1s+tQw2PZI4CCjAtN GzXkN38wyBbGu5W1H2mH2ksI83SNdQEfIXmjM9raqlLlHWgo5UcGMK1IZIWasqmjJYFlzM OUgGPmYVDpQffZdEF4Xcquzv7FdxyO4= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=cd22YuAF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718238230; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dCT5E8awkjyh4X+jBIyuiArcOsYyb0Z5JPh6puWXozk=; b=cd22YuAFsQwfGZHoihTiLQqc+qPMipTVX8knoCEybwL64afTM3MlB1s+tQw2PZI4CCjAtN GzXkN38wyBbGu5W1H2mH2ksI83SNdQEfIXmjM9raqlLlHWgo5UcGMK1IZIWasqmjJYFlzM OUgGPmYVDpQffZdEF4Xcquzv7FdxyO4= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 90CDC13A7F for ; Thu, 13 Jun 2024 00:23:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 2NUsERU8amY9YQAAD6G6ig (envelope-from ) for ; Thu, 13 Jun 2024 00:23:49 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/4] btrfs-progs: convert: remove raid-stripe-tree support Date: Thu, 13 Jun 2024 09:53:22 +0930 Message-ID: <10ba4a99e2530189415822f088cee6c8de95e17b.1718238120.git.wqu@suse.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 82CC734B7F X-Spam-Score: -5.01 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-5.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; DWL_DNSWL_MED(-2.00)[suse.com:dkim]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; FROM_EQ_ENVFROM(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:dkim]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.com:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org The raid-stripe-tree (RST) feature is for zoned devices to support extra data profiles, and is not yet a stable feature (still requires CONFIG_BTRFS_DEBUG enabled kernel to support it). Furthermore the supported filesystems (ext*, reiserfs and ntfs) doesn't even support zoned devices, and even we force RST support for btrfs-convert, we would only create an empty tree for RST, as btrfs convert would only result SINGLE data profile with SINGLE/DUP metadata profile, neither needs RST at all. Meanwhile enabling RST for btrfs-convert would only cause problems for false test failures as we incorrectly allow RST feature for btrfs-convert. This patch fixes the problem by remove raid-stripe-tree support from btrfs-convert and remove the test cases support for RST. This patch is mostly reverting commit 346a3819237b ("btrfs-progs: convert: add raid-stripe-tree to allowed features"), but keeps the test infrastructure to support bgt features for convert. Signed-off-by: Qu Wenruo --- common/fsfeatures.h | 3 +-- tests/convert-tests/001-ext2-basic/test.sh | 2 +- tests/convert-tests/003-ext4-basic/test.sh | 2 +- tests/convert-tests/005-delete-all-rollback/test.sh | 2 +- tests/convert-tests/010-reiserfs-basic/test.sh | 2 +- tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh | 2 +- tests/convert-tests/024-ntfs-basic/test.sh | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/common/fsfeatures.h b/common/fsfeatures.h index 5b241bdf9122..f636171f6bd9 100644 --- a/common/fsfeatures.h +++ b/common/fsfeatures.h @@ -68,8 +68,7 @@ static const struct btrfs_mkfs_features btrfs_convert_allowed_features = { BTRFS_FEATURE_INCOMPAT_BIG_METADATA | BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF | BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA | - BTRFS_FEATURE_INCOMPAT_NO_HOLES | - BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE, + BTRFS_FEATURE_INCOMPAT_NO_HOLES, .runtime_flags = BTRFS_FEATURE_RUNTIME_QUOTA, }; diff --git a/tests/convert-tests/001-ext2-basic/test.sh b/tests/convert-tests/001-ext2-basic/test.sh index 461ff4a5f1a9..d905ed4aeecb 100755 --- a/tests/convert-tests/001-ext2-basic/test.sh +++ b/tests/convert-tests/001-ext2-basic/test.sh @@ -12,7 +12,7 @@ check_kernel_support_acl # Iterate over defaults and options that are not tied to hardware capabilities # or number of devices -for feature in '' 'block-group-tree' 'raid-stripe-tree'; do +for feature in '' 'block-group-tree'; do convert_test ext2 "$feature" "ext2 4k nodesize" 4096 mke2fs -b 4096 convert_test ext2 "$feature" "ext2 16k nodesize" 16384 mke2fs -b 4096 convert_test ext2 "$feature" "ext2 64k nodesize" 65536 mke2fs -b 4096 diff --git a/tests/convert-tests/003-ext4-basic/test.sh b/tests/convert-tests/003-ext4-basic/test.sh index 14637fc852db..83a2cf12425c 100755 --- a/tests/convert-tests/003-ext4-basic/test.sh +++ b/tests/convert-tests/003-ext4-basic/test.sh @@ -12,7 +12,7 @@ check_kernel_support_acl # Iterate over defaults and options that are not tied to hardware capabilities # or number of devices -for feature in '' 'block-group-tree' 'raid-stripe-tree' ; do +for feature in '' 'block-group-tree'; do convert_test ext4 "$feature" "ext4 4k nodesize" 4096 mke2fs -t ext4 -b 4096 convert_test ext4 "$feature" "ext4 16k nodesize" 16384 mke2fs -t ext4 -b 4096 convert_test ext4 "$feature" "ext4 64k nodesize" 65536 mke2fs -t ext4 -b 4096 diff --git a/tests/convert-tests/005-delete-all-rollback/test.sh b/tests/convert-tests/005-delete-all-rollback/test.sh index 5603d3078bc8..536d0313ffdc 100755 --- a/tests/convert-tests/005-delete-all-rollback/test.sh +++ b/tests/convert-tests/005-delete-all-rollback/test.sh @@ -68,7 +68,7 @@ do_test() { # Iterate over defaults and options that are not tied to hardware capabilities # or number of devices -for feature in '' 'block-group-tree' 'raid-stripe-tree' ; do +for feature in '' 'block-group-tree'; do do_test "$feature" "ext4 4k nodesize" 4096 mke2fs -t ext4 -b 4096 do_test "$feature" "ext4 16k nodesize" 16384 mke2fs -t ext4 -b 4096 do_test "$feature" "ext4 64k nodesize" 65536 mke2fs -t ext4 -b 4096 diff --git a/tests/convert-tests/010-reiserfs-basic/test.sh b/tests/convert-tests/010-reiserfs-basic/test.sh index 6ab02b31d176..67e818b9827d 100755 --- a/tests/convert-tests/010-reiserfs-basic/test.sh +++ b/tests/convert-tests/010-reiserfs-basic/test.sh @@ -15,7 +15,7 @@ prepare_test_dev # Iterate over defaults and options that are not tied to hardware capabilities # or number of devices -for feature in '' 'block-group-tree' 'raid-stripe-tree'; do +for feature in '' 'block-group-tree'; do convert_test reiserfs "$feature" "reiserfs 4k nodesize" 4096 mkreiserfs -b 4096 convert_test reiserfs "$feature" "reiserfs 16k nodesize" 16384 mkreiserfs -b 4096 convert_test reiserfs "$feature" "reiserfs 64k nodesize" 65536 mkreiserfs -b 4096 diff --git a/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh b/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh index 688613c2c6ad..d874422659a6 100755 --- a/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh +++ b/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh @@ -70,7 +70,7 @@ do_test() { # Iterate over defaults and options that are not tied to hardware capabilities # or number of devices -for feature in '' 'block-group-tree' 'raid-stripe-tree'; do +for feature in '' 'block-group-tree'; do do_test "$feature" "reiserfs 4k nodesize" 4096 mkreiserfs -b 4096 do_test "$feature" "reiserfs 16k nodesize" 16384 mkreiserfs -b 4096 do_test "$feature" "reiserfs 64k nodesize" 65536 mkreiserfs -b 4096 diff --git a/tests/convert-tests/024-ntfs-basic/test.sh b/tests/convert-tests/024-ntfs-basic/test.sh index a93f60070674..b88dbe29c356 100755 --- a/tests/convert-tests/024-ntfs-basic/test.sh +++ b/tests/convert-tests/024-ntfs-basic/test.sh @@ -17,6 +17,6 @@ prepare_test_dev # Iterate over defaults and options that are not tied to hardware capabilities # or number of devices. Test only 4K block size as minimum. -for feature in '' 'block-group-tree' 'raid-stripe-tree'; do +for feature in '' 'block-group-tree'; do convert_test ntfs "$feature" "ntfs 4k nodesize" 4096 mkfs.ntfs -s 4096 done From patchwork Thu Jun 13 00:23:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13695702 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 C5F88611B for ; Thu, 13 Jun 2024 00:23:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238235; cv=none; b=URnyCgPop9Hds6Ho2pmxU93kOFChJd0x8WDXektN9l5hUrwSATJ5NdlDRAjOeji0qVoA4ja1LJUO9rUyE+WVtoe8DvxHtA8FEv938gyp1IIELdTEaO7OIFQlIe31YDEOpREjygBWJy+haFcm0aVZg8I9Xj6pwscXoSwEyuZSuX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238235; c=relaxed/simple; bh=jwC+OVHni/fuKFIT7QB2E/SZOES/UkPT1L197dW7WLI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JAK/izUPYDW7bNgp3zRS4VnhuiOxAobz2FVFjeC3gAnyuMZiZ6Xrmw9h59dbdVHfIYnsGNsE1I0ha7uAWgxtJhqOhSV9NjszoeyIcAA+ei7nnnKjuR5yL+FvgsK27Ur5B64jdVAbk6+twBb5WEXAtaHOKvKo9cNRGrDz1QsXMfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=I79RsIbz; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=I79RsIbz; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="I79RsIbz"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="I79RsIbz" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1150C5CA0F for ; Thu, 13 Jun 2024 00:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718238232; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rLHcX1wvEV9IrSC72QZZtvaIQmnrwY6q7yKlsqG4mjM=; b=I79RsIbzMudti1TAFo5vV17TDz5Z2BLbKlz88w4Hd5OeucUfZKO+IR19A9FF8qMpkUbtNR oqvUCizkm+XO02JJXByGelf4fChfbyeJSadqJmt/usfrznjLJTXE2Pvlu2yO53VcQ9tz9a kgeZSD/PeD4GtLIOsWNV0qGpqlAKTLE= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718238232; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rLHcX1wvEV9IrSC72QZZtvaIQmnrwY6q7yKlsqG4mjM=; b=I79RsIbzMudti1TAFo5vV17TDz5Z2BLbKlz88w4Hd5OeucUfZKO+IR19A9FF8qMpkUbtNR oqvUCizkm+XO02JJXByGelf4fChfbyeJSadqJmt/usfrznjLJTXE2Pvlu2yO53VcQ9tz9a kgeZSD/PeD4GtLIOsWNV0qGpqlAKTLE= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1F23013A7F for ; Thu, 13 Jun 2024 00:23:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id mEr7MBY8amY9YQAAD6G6ig (envelope-from ) for ; Thu, 13 Jun 2024 00:23:50 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/4] btrfs-progs: hide rst related mkfs tests behind experimental builds Date: Thu, 13 Jun 2024 09:53:23 +0930 Message-ID: <5355fb34cfa7fffd9af3be919b182561189ecb69.1718238120.git.wqu@suse.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: -2.80 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; RCVD_TLS_ALL(0.00)[] Currently we unconditionally run mkfs/029 and mkfs/030 as we export RST feature through mkfs.btrfs as supported features. But considering the mkfs.btrfs features are mismatch with kernel support (only a BTRFS_DEBUG kernel can support that), we're going to hide RST behind experimental builds. In that case RST related tests cases also need to be behind experimental builds as regular builds of mkfs.btrfs will no longer support RST feature. This patch would introduce two helpers: - _test_config() To verify if certain config is set to 1 - check_experimental_build() A wrapper of "_test_config EXPERIMENTAL", and skip the test if btrfs-progs has no experimental features. So that test cases can be skipped for non-experimental builds. Signed-off-by: Qu Wenruo --- tests/common | 22 +++++++++++++++++++ tests/mkfs-tests/029-raid-stripe-tree/test.sh | 1 + tests/mkfs-tests/030-zoned-rst/test.sh | 1 + 3 files changed, 24 insertions(+) diff --git a/tests/common b/tests/common index 7a23f6dde1a5..e9456c1d96b8 100644 --- a/tests/common +++ b/tests/common @@ -6,6 +6,21 @@ # Temporary array for building the final command, injecting arguments as needed declare -a cmd_array +# Check if certain config is set to 1 +_test_config() +{ + local feature="$1" + + if [ ! -f "${TOP}/include/config.h" ]; then + echo "include/config.h not exists" + exit 1 + fi + if grep -q "${feature}.*1" "${TOP}/include/config.h"; then + return 0 + fi + return 1 +} + # assert that argument is not empty and is an existing path (file or directory) _assert_path() { @@ -370,6 +385,13 @@ run_mustfail_stdout() fi } +check_experimental_build() +{ + if ! _test_config "EXPERIMENTAL"; then + _not_run "This test requires experimental build" + fi +} + check_prereq() { # Internal tools for testing, not shipped with the package diff --git a/tests/mkfs-tests/029-raid-stripe-tree/test.sh b/tests/mkfs-tests/029-raid-stripe-tree/test.sh index c3edd36d8761..f200d068fe79 100755 --- a/tests/mkfs-tests/029-raid-stripe-tree/test.sh +++ b/tests/mkfs-tests/029-raid-stripe-tree/test.sh @@ -3,6 +3,7 @@ source "$TEST_TOP/common" || exit +check_experimental_build check_prereq mkfs.btrfs check_prereq btrfs diff --git a/tests/mkfs-tests/030-zoned-rst/test.sh b/tests/mkfs-tests/030-zoned-rst/test.sh index b1c696c96eb7..b03c691f1b69 100755 --- a/tests/mkfs-tests/030-zoned-rst/test.sh +++ b/tests/mkfs-tests/030-zoned-rst/test.sh @@ -3,6 +3,7 @@ source "$TEST_TOP/common" || exit +check_experimental_build setup_root_helper setup_nullbdevs 4 128 4 prepare_nullbdevs From patchwork Thu Jun 13 00:23:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13695703 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 750DB79FE for ; Thu, 13 Jun 2024 00:23:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238237; cv=none; b=Ezun5Ed3tm0LpDMXajDeRO1HGD3SehSbMB62ys5C/GrWew6a5Lt8E2BCyy9Wg5bJ6r3nkciZL/OOyghuHuNIkrYDS+Kkx3UBjvu7klhyixT3V3xgbWR1BrcIabbjrw4R8z3jbC6TaKaLf9pj2bzr1N6hnP1fzvUI6oSZTt5VbKY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238237; c=relaxed/simple; bh=ku6w0AvipZ4TABTl6uySUTe0pn/hOYlQFNZ2i9n8opA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CbuT5mKuIT/8TmUqdcf1Ub6RHJJu2cbYd3XYiy2g9lk9nBUqfW1oHEii5Bqs+WbYz/9wyi50G+2E1Z0yK06zN4fMlVYpqpiYN43h0nqE6Hjb60+gXrqgOQLWTt+9Nx2L//+S2rFZHuM4oxsnHB5BqEf759CAFGOeJ/mxlnxX4J8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=gMiQzblh; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=gMiQzblh; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="gMiQzblh"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="gMiQzblh" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 942E134B81 for ; Thu, 13 Jun 2024 00:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718238233; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MmSo04ZDBCoSogeO+jC4zCQT4382colhB2J8B2pDmcU=; b=gMiQzblhjc2gFmTj0KeIeCCOVzLA/OOx1mv6cMiSry5aboSzTwAoU4BH3NT1O5qrqXIkoC 5xUWreCtsOqtJ3nSYNht+AkxDnVRMB2yofdkJAJ0GY/jTEkIsnKvo+aObDHqnfByhNxCoM HN+Xm+R2fDe820OSCUTrA7ETV8dRuC0= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=gMiQzblh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718238233; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MmSo04ZDBCoSogeO+jC4zCQT4382colhB2J8B2pDmcU=; b=gMiQzblhjc2gFmTj0KeIeCCOVzLA/OOx1mv6cMiSry5aboSzTwAoU4BH3NT1O5qrqXIkoC 5xUWreCtsOqtJ3nSYNht+AkxDnVRMB2yofdkJAJ0GY/jTEkIsnKvo+aObDHqnfByhNxCoM HN+Xm+R2fDe820OSCUTrA7ETV8dRuC0= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A2C9713A7F for ; Thu, 13 Jun 2024 00:23:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MGtUFRg8amY9YQAAD6G6ig (envelope-from ) for ; Thu, 13 Jun 2024 00:23:52 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 3/4] btrfs-progs: fsfeatures: move RST back to experimental Date: Thu, 13 Jun 2024 09:53:24 +0930 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 942E134B81 X-Spam-Score: -5.01 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-5.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; DWL_DNSWL_MED(-2.00)[suse.com:dkim]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; FROM_EQ_ENVFROM(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:dkim]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.com:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Currently raid-stripe-tree feature is still experimental as it requires a BTRFS_DEBUG kernel to recognize it. To avoid confusion move it back to experimental so regular users won't incorrectly set it. And since RST is no longer supported by default, also change the RST profile detection so that for non-experimental build we won't enable RST according to the data profiles. Signed-off-by: Qu Wenruo --- common/fsfeatures.c | 2 ++ mkfs/main.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/common/fsfeatures.c b/common/fsfeatures.c index c5e81629ccea..7aaddab6a192 100644 --- a/common/fsfeatures.c +++ b/common/fsfeatures.c @@ -222,6 +222,7 @@ static const struct btrfs_feature mkfs_features[] = { VERSION_NULL(default), .desc = "block group tree, more efficient block group tracking to reduce mount time" }, +#if EXPERIMENTAL { .name = "rst", .incompat_flag = BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE, @@ -238,6 +239,7 @@ static const struct btrfs_feature mkfs_features[] = { VERSION_NULL(default), .desc = "raid stripe tree, enhanced file extent tracking" }, +#endif { .name = "squota", .incompat_flag = BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA, diff --git a/mkfs/main.c b/mkfs/main.c index 0b9d1d78663d..8d0924ea3b0b 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -1693,7 +1693,9 @@ int BOX_MAIN(mkfs)(int argc, char **argv) case BTRFS_BLOCK_GROUP_RAID1C4: case BTRFS_BLOCK_GROUP_RAID0: case BTRFS_BLOCK_GROUP_RAID10: +#if EXPERIMENTAL features.incompat_flags |= BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE; +#endif break; default: break; From patchwork Thu Jun 13 00:23:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13695704 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 2BC70522E for ; Thu, 13 Jun 2024 00:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238239; cv=none; b=LPsqE6/acpOlDHrvT58YXk077mbmf8I1rl+qyXjNwCcYL2z6AwRF2w2Eb+ntT5zOgfy9Xc3AAPY5VSX/yubMOlausVBz+VlWbClGlBdtEqtRyeNMFsf1SZyAfCnNFVnKf/7XaNVFRcHPaogj0MzN1ExUDSvCF9vTm1aRmleLPWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238239; c=relaxed/simple; bh=CK9wyzaGIZJ/uZ1QepMOO4D/eiJTgBiFi2WvkW5NDx8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qI9Jw4vXN/Tu+Dawp9Q1uj8NePeuEByotVWUpWfphmumxcOawDVviXd+zA62RDhlKtUEiKqLHeggiBcuY2E9nwQefSgz2/nCmWBIUirz/1RO4yOgzo17eYnut3jC2zRMoBeMvLAGYu3AWTNW/ZRRD+B0BYSkRAhwn2Xla4/oxkc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=VHvwqRgk; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=VHvwqRgk; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="VHvwqRgk"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="VHvwqRgk" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 558F75CA10 for ; Thu, 13 Jun 2024 00:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718238235; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6XEpMLnWFv1AluBDKGiBCSm1uarJDsx3gEpA+TyD13o=; b=VHvwqRgkJi3pOZnsyw6qSmh7sYkUqgGxYdMhzRSMon1pbUIProp1jiSxRtXEtL3QoYLYfk lH5BYWvS0vA9LleF1neZK4VUM0+JFRUFpaW9WR8it9HII+cXfgQ8tAeT24TdnY3yMulAF9 WLLgsaeVu3d4C3sUX9iU0kcCC3K1t8I= Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=VHvwqRgk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718238235; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6XEpMLnWFv1AluBDKGiBCSm1uarJDsx3gEpA+TyD13o=; b=VHvwqRgkJi3pOZnsyw6qSmh7sYkUqgGxYdMhzRSMon1pbUIProp1jiSxRtXEtL3QoYLYfk lH5BYWvS0vA9LleF1neZK4VUM0+JFRUFpaW9WR8it9HII+cXfgQ8tAeT24TdnY3yMulAF9 WLLgsaeVu3d4C3sUX9iU0kcCC3K1t8I= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 631B413A7F for ; Thu, 13 Jun 2024 00:23:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id WO1vOxk8amY9YQAAD6G6ig (envelope-from ) for ; Thu, 13 Jun 2024 00:23:53 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 4/4] btrfs-progs: mkfs-tests: ensure regular builds won't enable rst feature Date: Thu, 13 Jun 2024 09:53:25 +0930 Message-ID: <48ce67476f6674725c5e87e25373d8e86df0cb46.1718238120.git.wqu@suse.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Result: default: False [-5.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; DWL_DNSWL_MED(-2.00)[suse.com:dkim]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; FROM_EQ_ENVFROM(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:dkim]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.com:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 558F75CA10 X-Spam-Flag: NO X-Spam-Score: -5.01 X-Spam-Level: This test case will check the following behaivors: - Regular zoned supported data/metadata profiles Should success - RST with zoned feature Should fail for non-experimental builds - zoned with data profiles that only RST supports Should fail for non-experimental builds. Meanwhile for experimental builds it should success and enable RST feature automatically (verified in mkfs/030) Signed-off-by: Qu Wenruo --- tests/common | 7 ++++ tests/mkfs-tests/033-zoned-reject-rst/test.sh | 34 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 tests/mkfs-tests/033-zoned-reject-rst/test.sh diff --git a/tests/common b/tests/common index e9456c1d96b8..12ec1ad92b85 100644 --- a/tests/common +++ b/tests/common @@ -392,6 +392,13 @@ check_experimental_build() fi } +check_regular_build() +{ + if _test_config "EXPERIMENTAL"; then + _not_run "This test requires non-experimental build" + fi +} + check_prereq() { # Internal tools for testing, not shipped with the package diff --git a/tests/mkfs-tests/033-zoned-reject-rst/test.sh b/tests/mkfs-tests/033-zoned-reject-rst/test.sh new file mode 100755 index 000000000000..698551eccd59 --- /dev/null +++ b/tests/mkfs-tests/033-zoned-reject-rst/test.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Verify mkfs for all currently supported profiles of zoned + raid-stripe-tree + +source "$TEST_TOP/common" || exit + +check_regular_build +setup_root_helper +setup_nullbdevs 4 128 4 +prepare_nullbdevs +TEST_DEV=${nullb_devs[1]} + +profiles="dup raid1 raid1c3 raid1c4 raid10" + +# The existing supported profiles. +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d single -m single "${nullb_devs[@]}" +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d single -m DUP "${nullb_devs[@]}" + +# RST feature is rejected +run_mustfail "RST feature created" \ + $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned,raid-stripe-tree -d single -m DUP "${nullb_devs[@]}" + +for dprofile in $profiles; do + # make sure extra data profiles won't enable RST for non-experimental build + run_mustfail "unsupported profile created" \ + $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d "$dprofile" -m DUP "${nullb_devs[@]}" +done + +# The old unsupported profiles should fail no matter experimental build or not. +run_mustfail "unsupported profile raid56 created" \ + $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d raid5 -m raid5 "${nullb_devs[@]}" +run_mustfail "unsupported profile raid56 created" \ + $SUDO_HELPER "$TOP/mkfs.btrfs" -f -O zoned -d raid6 -m raid6 "${nullb_devs[@]}" + +cleanup_nullbdevs