From patchwork Tue Mar 19 18:12:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13597005 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 69C3E3985A for ; Tue, 19 Mar 2024 18:19:15 +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=1710872357; cv=none; b=svYWh57SbJsEp7gTjLeMT98Kz2tkf7+iDDjPw+G+6dtuOnO5vO27VJyvFCz/6ekLzKslDBNdc81yAzKQi4z/Ag12O642YOeV39KsWRqDm4A3uM0OtWJ9rnZGAO3qiqo5IMY5+j1RmDwsJ5H6gDvvbusQ31fHBFEXIHzvnMH844c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872357; c=relaxed/simple; bh=z7tkQLJaFxbsIMjVUmGixp852DF4hTqmrcZYYNz09WA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O67gJc+NltLyfeZ8up0HmpZ/jvN8NOKKXxC/bQVb/RJ4hZz9Z+3DWDCM1XBcG36YDa2ex60y7sC7LFDr9p6N0PFiZJMG1ejbeICLg6+JHD+qI/TF+b3Ec4m8kUDpqhPB3rlN0CTziWxYXpp2j/IFVEP8Zrc12ZN41yxQgUhhDys= 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=coFxsLLe; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=coFxsLLe; 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="coFxsLLe"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="coFxsLLe" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 80A5F1F46E; Tue, 19 Mar 2024 18:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872353; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uuwtaYFspQURRhm1ZhJJM7/HhvkM2Lo97+FxTlR6kU4=; b=coFxsLLeqpXtAXL5ACrYGTHNiVH93UqwTGnDEg17ti6k6atS46u/FdGvvmNc+GvdYFwQxV n4sdy9HLthpuBxEZjUCKf4f/eniQLXXAJYkILz0GDDir539nIl/6iZLHfHm3XzQbx/lGOB bSmD+1kVqA27rzpWliGg98disXdSQeE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872353; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uuwtaYFspQURRhm1ZhJJM7/HhvkM2Lo97+FxTlR6kU4=; b=coFxsLLeqpXtAXL5ACrYGTHNiVH93UqwTGnDEg17ti6k6atS46u/FdGvvmNc+GvdYFwQxV n4sdy9HLthpuBxEZjUCKf4f/eniQLXXAJYkILz0GDDir539nIl/6iZLHfHm3XzQbx/lGOB bSmD+1kVqA27rzpWliGg98disXdSQeE= 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 7A18C136D6; Tue, 19 Mar 2024 18:19:13 +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 VFbMHSHX+WWGSwAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 18:19:13 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik Subject: [PATCH 1/5] common/verity: use the correct options for btrfs-corrupt-block Date: Tue, 19 Mar 2024 19:12:00 +0100 Message-ID: <0b2ef42d6fb3e3b6ebe91c84b9a5e698af13d80b.1710871719.git.dsterba@suse.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.70 X-Spamd-Result: default: False [3.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[15.44%] X-Spam-Flag: NO From: Josef Bacik A long time ago we changed the short options to long options in btrfs-corrupt-block, so adjust the helper to use the correct options so the verity tests pass properly. Signed-off-by: Josef Bacik --- common/verity | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/verity b/common/verity index 03d175ce1b7a18..0e5f0d75e746a8 100644 --- a/common/verity +++ b/common/verity @@ -402,7 +402,7 @@ _fsv_scratch_corrupt_merkle_tree() # in the default filesystem tree (-r 5) and corrupt one byte (-b 1) at # $offset (-o $offset) with the ascii representation of the byte we read # (-v $ascii) - $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 -v $ascii -o $offset -b 1 $SCRATCH_DEV + $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 --value $ascii --offset $offset -b 1 $SCRATCH_DEV (( offset += 1 )) done _scratch_mount From patchwork Tue Mar 19 18:12:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13597006 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 A8A3439AC4 for ; Tue, 19 Mar 2024 18:19:17 +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=1710872359; cv=none; b=GugknbnOV82UfQ5dIAKtXnVEYuzLm6yrkPfXiw3ZG05kYeHrICfP+I2PzpFABVcFDnwTMnG8+ye9rlSydVRCjQC0n4yJjLYLFTbuRROv2rFSoZ7p3vkfGGm8FDxQKOyKeKssPdBk9Qulzr8+k6gCkaL5DscA8k9P8hlXbGrJ63c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872359; c=relaxed/simple; bh=KozunVOiZ05pbNuMLn7q12+RuUGyNkWu1aUIV5smFI8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jUJ2E6GA9mKzmkbes9E1mQcw7Iq3sMY+6O6YhyZsnsnGKMRCCkFTeDk94kzH3lqdbNfaDtoZH6LUDGj9NDWm3c0f+3dCp0jiTRjwG4KgR0BqcJB34UkKMvtbXOlWY5080RKWPz3HPh2dDs7q0LyUk6an080n+oreIoBfW3i8rso= 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=ZG7TFZpo; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=ZG7TFZpo; 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="ZG7TFZpo"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="ZG7TFZpo" 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 D806321CE3; Tue, 19 Mar 2024 18:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872355; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FfnRs7C5KxW5Uu9Xc6KVyWF1lCgJJxEyXsX0kddv3is=; b=ZG7TFZpoLVddp2n5jWUrJJxIG3yn6pwjQxeeTB9YWk3ks/i9RzopAzY+xSp+UolYNtizM6 LmnlycBzivgolwSEc4O5mtEI9lttCq6JmRqoj4PgU1bwdsXuh4MQj+GCQe8Bn77RuDwh+/ hppjZLnZdrMphJEfWfT5kXw5H0ZZszA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872355; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FfnRs7C5KxW5Uu9Xc6KVyWF1lCgJJxEyXsX0kddv3is=; b=ZG7TFZpoLVddp2n5jWUrJJxIG3yn6pwjQxeeTB9YWk3ks/i9RzopAzY+xSp+UolYNtizM6 LmnlycBzivgolwSEc4O5mtEI9lttCq6JmRqoj4PgU1bwdsXuh4MQj+GCQe8Bn77RuDwh+/ hppjZLnZdrMphJEfWfT5kXw5H0ZZszA= 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 D2344136D6; Tue, 19 Mar 2024 18:19:15 +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 lclOMyPX+WWKSwAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 18:19:15 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik Subject: [PATCH 2/5] btrfs/131,btrfs/172,btrfs/206: add check for block-group-tree feature in btrfs Date: Tue, 19 Mar 2024 19:12:03 +0100 Message-ID: <7e5a4dbefa3edb834560891feec6ecf3382bb9e0.1710871719.git.dsterba@suse.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=ZG7TFZpo X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.49 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: 0.49 X-Rspamd-Queue-Id: D806321CE3 X-Spam-Flag: NO From: Josef Bacik A new disk format option will make the no-holes option a requirement, so add a helper to make sure that we aren't creating a fs with BLOCK_GROUP_TREE by default, and skip the tests that require turning off no-holes. Signed-off-by: Josef Bacik Reviewed-by: Anand Jain --- common/btrfs | 10 ++++++++++ tests/btrfs/131 | 2 ++ tests/btrfs/172 | 3 +++ tests/btrfs/206 | 3 +++ 4 files changed, 18 insertions(+) diff --git a/common/btrfs b/common/btrfs index aa344706cd5f81..c1c3c4683a6fe6 100644 --- a/common/btrfs +++ b/common/btrfs @@ -148,6 +148,16 @@ _require_btrfs_free_space_tree() fi } +_require_btrfs_no_block_group_tree() +{ + _scratch_mkfs > /dev/null 2>&1 + if $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | \ + grep -q "BLOCK_GROUP_TREE" + then + _notrun "This test requires no block-group-tree" + fi +} + _check_btrfs_filesystem() { device=$1 diff --git a/tests/btrfs/131 b/tests/btrfs/131 index 529ee3e80f87eb..d34fc8d53801b3 100755 --- a/tests/btrfs/131 +++ b/tests/btrfs/131 @@ -20,6 +20,8 @@ _require_btrfs_command inspect-internal dump-super _require_btrfs_fs_feature free_space_tree # Zoned btrfs does not support space_cache(v1) _require_non_zoned_device "${SCRATCH_DEV}" +# Block group tree does not support space_cache(v1) +_require_btrfs_no_block_group_tree _scratch_mkfs >/dev/null 2>&1 [ "$(_get_page_size)" -gt "$(_scratch_btrfs_sectorsize)" ] && \ diff --git a/tests/btrfs/172 b/tests/btrfs/172 index f2997c047effb0..964251b449de20 100755 --- a/tests/btrfs/172 +++ b/tests/btrfs/172 @@ -32,6 +32,9 @@ _require_scratch _require_log_writes _require_xfs_io_command "sync_range" +# block-group-tree requires no-holes +_require_btrfs_no_block_group_tree + _log_writes_init $SCRATCH_DEV _log_writes_mkfs "-O ^no-holes" >> $seqres.full 2>&1 diff --git a/tests/btrfs/206 b/tests/btrfs/206 index 6ac3d27bbde375..02a5082046f4a5 100755 --- a/tests/btrfs/206 +++ b/tests/btrfs/206 @@ -33,6 +33,9 @@ _require_log_writes _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fpunch" +# block-group-tree requires no-holes +_require_btrfs_no_block_group_tree + _log_writes_init $SCRATCH_DEV _log_writes_mkfs "-O ^no-holes" >> $seqres.full 2>&1 From patchwork Tue Mar 19 18:12:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13597007 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 07C6E39AC4 for ; Tue, 19 Mar 2024 18:19:19 +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=1710872362; cv=none; b=T8RoVD5/+wPBOiJGICvGkJVXGZECPIMMDvY4i9fVDBjR6cXqlTzQd/5xD6esfrp7Ju8y3X0bEPJPSO2SHy5vATl2NuD5dOdRMQK26tpEGlQr20riFyVY1JAPTNP/SEt2HXtLhNF4aR2/x3HzzcwXK79hiMjzkiFflczaKjgDgf0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872362; c=relaxed/simple; bh=VpfWbvqlzmlV7My27EaFB+8tLwd3H8iNEZQ+IH6yT9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FR3DCRlns+cJPNY2zaw8EEJIfaOq2A4AY3RQMFF9T3VuKAMKOtHnYJBAo4g7aEs7cROFvcVuNSQYvcaynl4FueRoqZza0QBVwmSBG/lzB4QWB4R3TK/4/ev23ZP9CVKfuiyHzljZD3P9lTJeUClXLQcVqMf/4tnww/3iim2xD30= 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=JLnmRFK8; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=JLnmRFK8; 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="JLnmRFK8"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="JLnmRFK8" 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 3EDC61F452; Tue, 19 Mar 2024 18:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872358; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m5rpm77qAK+UprBCeQ3XKGYtoANHLeJejOZxjeFScDU=; b=JLnmRFK8BBd1uXOJvF22scpZYIeviPoEe+jF5CHiLOVNW9M+QumEzq9GGupghFLsIzwyoJ 9cxAQu9QPtvchRfijAu1/lNFsrLhTvCH3o6oO/2B2DGB+g2s1Aj/Jmriqn8BHWf+Appk00 ICs/LGRe1X4WHz/F2BMLbo7xCiUAh5Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872358; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m5rpm77qAK+UprBCeQ3XKGYtoANHLeJejOZxjeFScDU=; b=JLnmRFK8BBd1uXOJvF22scpZYIeviPoEe+jF5CHiLOVNW9M+QumEzq9GGupghFLsIzwyoJ 9cxAQu9QPtvchRfijAu1/lNFsrLhTvCH3o6oO/2B2DGB+g2s1Aj/Jmriqn8BHWf+Appk00 ICs/LGRe1X4WHz/F2BMLbo7xCiUAh5Q= 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 382E5136D6; Tue, 19 Mar 2024 18:19:18 +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 Fxy1DSbX+WWSSwAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 18:19:18 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik Subject: [PATCH 3/5] btrfs/330: add test to validate ro/rw subvol mounting Date: Tue, 19 Mar 2024 19:12:05 +0100 Message-ID: X-Mailer: git-send-email 2.42.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: 0.52 Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=JLnmRFK8 X-Spamd-Bar: / X-Spam-Flag: NO X-Spamd-Result: default: False [0.52 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.17)[-0.848]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from] X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 3EDC61F452 From: Josef Bacik Btrfs has had the ability for almost a decade to allow ro and rw mounting of subvols. This behavior specifically mount -o subvol=foo,ro /some/dir mount -o subvol=bar,rw /some/other/dir This seems simple, but because of the limitations of how we did mounting in ye olde days we would mark the super block as RO and the mount if we mounted RO first. In the case above /some/dir would instantiate the super block as read only and the mount point. So the second mount command under the covers would convert the super block to RW, and then allow the mount to continue. The results were still consistent, /some/dir was still read only because the mount was marked read only, but /some/other/dir could be written to. This is a test to make sure we maintain this behavior, as I almost regressed this behavior while converting us to the new mount API. Signed-off-by: Josef Bacik Reviewed-by: Anand Jain --- tests/btrfs/330 | 54 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/330.out | 6 +++++ 2 files changed, 60 insertions(+) create mode 100755 tests/btrfs/330 create mode 100644 tests/btrfs/330.out diff --git a/tests/btrfs/330 b/tests/btrfs/330 new file mode 100755 index 00000000000000..3ce9840e76d028 --- /dev/null +++ b/tests/btrfs/330 @@ -0,0 +1,54 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2023 Meta Platforms, Inc. All Rights Reserved. +# +# FS QA Test No. btrfs/330 +# +# Test mounting one subvolume as ro and another as rw +# +. ./common/preamble +_begin_fstest auto quick subvol + +_cleanup() +{ + rm -rf $TEST_DIR/$seq +} + +# Import common functions. +. ./common/filter +. ./common/filter.btrfs + +# real QA test starts here +_supported_fs btrfs +_require_scratch + +$MOUNT_PROG -V | grep -q 'fd-based-mount' +[ "$?" -eq 0 ] && _notrun "mount uses the new mount api" + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount + +# Create our subvolumes to mount +$BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/foo | _filter_scratch +$BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/bar | _filter_scratch + +_scratch_unmount + +mkdir -p $TEST_DIR/$seq/foo +mkdir -p $TEST_DIR/$seq/bar + +_mount -t btrfs -o subvol=foo,ro $SCRATCH_DEV $TEST_DIR/$seq/foo +_mount -t btrfs -o subvol=bar,rw $SCRATCH_DEV $TEST_DIR/$seq/bar + +echo "making sure foo is read only" +touch $TEST_DIR/$seq/foo/baz > /dev/null 2&>1 +ls $TEST_DIR/$seq/foo + +echo "making sure bar allows writes" +touch $TEST_DIR/$seq/bar/qux +ls $TEST_DIR/$seq/bar + +$UMOUNT_PROG $TEST_DIR/$seq/foo +$UMOUNT_PROG $TEST_DIR/$seq/bar + +status=0 ; exit diff --git a/tests/btrfs/330.out b/tests/btrfs/330.out new file mode 100644 index 00000000000000..4795a2ccc8cb62 --- /dev/null +++ b/tests/btrfs/330.out @@ -0,0 +1,6 @@ +QA output created by 330 +Create subvolume 'SCRATCH_MNT/foo' +Create subvolume 'SCRATCH_MNT/bar' +making sure foo is read only +making sure bar allows writes +qux From patchwork Tue Mar 19 18:12:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13597008 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 640933612D for ; Tue, 19 Mar 2024 18:19:22 +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=1710872364; cv=none; b=RQUdUC2tU3kEd6RJD7aPtEV7jFjOhiDrGKz0qYqQdGElebv/ILxt11z8FTGp/ifWdAH4H3ajcd/9/HBgtHvUw0jn1ixbamef6ROJ8mIw4Gv85ACTVflT2oE2BmqXaHz541zmp2+UZX4AoNXLrDIqW/KfHl3ZB4qOGHsdSDA3ygE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872364; c=relaxed/simple; bh=2F0o13IB5ykzrpJZrasp0bgkBpAvK0fQeRAUmFQuYF8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b/6WDO4Src2YXMM45AU903hf/ISzmtSVJCIGcNFY9S8W8AyxUbIZEV34DfJS5G+VuWtn6Q5L+mEzQO5bgL/HPq5VSnhmFLXZoZRmlWF3IVUxnlIfsPDBFc5YDPKM/iSeVftKAlc2SqZ3fdCBrxlOVfCUuV0cyzPvctUxKuCStkI= 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=aiCY5RDW; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=aiCY5RDW; 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="aiCY5RDW"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="aiCY5RDW" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 9CAA71F454; Tue, 19 Mar 2024 18:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872360; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=feoRwtHcrS8oa6itZmGuS8rJwzHkzyv0RsmHWXh2b4U=; b=aiCY5RDWQK4wD2pZW5MAzzMRlJqe3SgN4Phcmgj/qTsPHTLyDu/k2xvr2oB6zr3514DUmo mbF+b/BwqCVdDEfR8v3wLnRr6EGHHgjugV3AfUJVGAtXaR7m98G08l3O6jlEPk8auwt4gd wHn1ZeLTS2IlupEcbrxRcSoAtGXWAlc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872360; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=feoRwtHcrS8oa6itZmGuS8rJwzHkzyv0RsmHWXh2b4U=; b=aiCY5RDWQK4wD2pZW5MAzzMRlJqe3SgN4Phcmgj/qTsPHTLyDu/k2xvr2oB6zr3514DUmo mbF+b/BwqCVdDEfR8v3wLnRr6EGHHgjugV3AfUJVGAtXaR7m98G08l3O6jlEPk8auwt4gd wHn1ZeLTS2IlupEcbrxRcSoAtGXWAlc= 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 9698A136D6; Tue, 19 Mar 2024 18:19:20 +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 NYzAJCjX+WWWSwAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 18:19:20 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: David Sterba Subject: [PATCH 4/5] common/rc: use proper temporary file path in _repair_test_fs() Date: Tue, 19 Mar 2024 19:12:07 +0100 Message-ID: X-Mailer: git-send-email 2.42.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: * X-Spam-Score: 1.13 X-Spamd-Result: default: False [1.13 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-2.57)[98.10%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO The path /tmp.repair would be on the system root that could not be writable, the temporary files are available at $tmp . Signed-off-by: David Sterba Reviewed-by: Anand Jain --- common/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index 37d26bf21b7c5f..ff2949bd05353d 100644 --- a/common/rc +++ b/common/rc @@ -1301,9 +1301,9 @@ _repair_test_fs() ;; btrfs) echo 'yes|$BTRFS_UTIL_PROG check --repair --force "$TEST_DEV"' > \ - /tmp.repair 2>&1 + $tmp.repair 2>&1 yes | $BTRFS_UTIL_PROG check --repair --force "$TEST_DEV" >> \ - /tmp.repair 2>&1 + $tmp.repair 2>&1 res=$? ;; *) From patchwork Tue Mar 19 18:12:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13597009 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 D23D638DC3 for ; Tue, 19 Mar 2024 18:19:26 +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=1710872368; cv=none; b=QwfOxRGAnk585ANy0kBeM9u00t9zfGtiNhFWVhSTKsjJIMYauJ1l3YrA8QNzADQ/vGu/ZXDxSl36E0cNfFqmTzAsKhnnjYtYzYPKzO3jjUXTlVkw8e/OtW3A383M3z4n6AGZBtGYGJ6HhxL6WfBLACASSrrgVwHqv0kN66AJNVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872368; c=relaxed/simple; bh=VwVDcY0TO2axL/jWjtCB35X3LH+tkbbNehoTlHqUSVw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PXFoOa5dYxDEkYPQaLpNEKKa8fXGIkkzEjqR9MeH+p2SWhc5i2zNlwWmjghHgHmjaZmj1rsMnBizIERiOLvpo529q37lIRfvOQSJCt/vyQPUD5D96BNEAEip/uDURJuff+HVl8sV6sTRoijlVs14uZlYiJgI5lKObnBiLWLLvYw= 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=sH6AynCi; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=Rh4mmzfS; 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="sH6AynCi"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="Rh4mmzfS" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 00E7221CE8; Tue, 19 Mar 2024 18:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872365; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=87IJRYlCZc3nG6YSubJqk7fid/9rRgikDam7bMyuKxM=; b=sH6AynCiM9FPRp3LixF9qWnWL0yDMMxKgYKnSXLwidEcvp7SVkacXatCzNrKmjGxze3O+8 vkEd6Hi/CIzdHtne/iyZ3Io4foPASOzOFsKP+/BsaCUfkjOYuZWbZ8IRBQyxUHOZs5wnfy 6p1NXigdl71RGHcrUOkiQ2LuJElc2cY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1710872363; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=87IJRYlCZc3nG6YSubJqk7fid/9rRgikDam7bMyuKxM=; b=Rh4mmzfSoM4XY4kRRZfpO7wvHPQrfU75XeokDZcOSpGqnvBIrPX28CPRgRdol35kL8ATzi r+Y4BZ0kSXtqDTdDqsgRB6sNIYFCneS/NaGkYTaIw4Xu95B4J72S09G1Bj/t+eKr6vuNFm xq/8zkVdrEEmYSI0M/O4jGtNSUIMIA4= 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 EEC84136D6; Tue, 19 Mar 2024 18:19:22 +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 aWVJOirX+WWaSwAAD6G6ig (envelope-from ); Tue, 19 Mar 2024 18:19:22 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: David Sterba , Josef Bacik , Filipe Manana Subject: [PATCH 5/5] generic/733: disable for btrfs Date: Tue, 19 Mar 2024 19:12:10 +0100 Message-ID: <094a1bdc304b236ba41aff4da454abe3c93a355c.1710871719.git.dsterba@suse.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.32 X-Spamd-Result: default: False [3.32 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[toxicpanda.com:email,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.38)[77.34%] X-Spam-Flag: NO This tests if a clone source can be read but in btrfs there's an exclusive lock and the test always fails. The functionality might be implemented in btrfs in the future but for now disable the test. CC: Josef Bacik Reviewed-by: Filipe Manana Signed-off-by: David Sterba --- tests/generic/733 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/733 b/tests/generic/733 index d88d92a4705add..adb141e190b7b0 100755 --- a/tests/generic/733 +++ b/tests/generic/733 @@ -18,7 +18,7 @@ _begin_fstest auto clone punch . ./common/reflink # real QA test starts here -_supported_fs generic +_supported_fs ^btrfs _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fpunch"