From patchwork Tue Mar 5 18:52: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: 13582884 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 1C5941AACF; Tue, 5 Mar 2024 18:59:10 +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=1709665153; cv=none; b=PaHdzLm8eSv8koSQ8wPfvL5GUOBfzmLelzZKVEMkNM3n69pX9S+pRDFoUx4UH46TytK4jCNY4sfCUFZZpfh59/kAKbd7YlVRJkCuaI0xib1zZmxibm2DJVGxKP24/ct6NwOIBoHOe+rnUUZ9XwQMHeXnJEbAiZs5M019z+tPodU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709665153; c=relaxed/simple; bh=jhZXT5QS+sQTsR4Zf5MCOXotkTXbHc16FYvPDYj719w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YJkQE0hnd5GEM07UPMyL5K7JaSbhZDVu8MljFC6NcwoZ7J2sELIM9+/Rsx0D/SMyikxwjV/Lf78RXON/UCNxrHzxLHjZuVPKWFYwG08jFZW+qG0mR9rEo8tgQv6zw5D4QkT+E3ljpyQ2ILv1+Is40gewlYgnAb9WvJHgX7fsXN4= 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=BPk8g1Oo; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=gh+5JYgm; 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="BPk8g1Oo"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="gh+5JYgm" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 D0D9B22A92; Tue, 5 Mar 2024 18:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665149; 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=gJ3RPk3x0DG3aRdeJlgXiel7sD0/H3U+Tb6ibktVg9k=; b=BPk8g1OoO6JF0GHB8gPmoT2/0UJ4ZlJtM+z4glT0eanMVgR+0XsDpTaFjd84NCmjFTaDGL PF6qb/h20qIYmryWNgSJpM3GxqdXzcRwd4/scaS74utsmiKk6iQhbFmiDSu7DzD6XutwE8 REic+NN4uAjvIgZEzZdqEFl4+oGMIKo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665148; 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=gJ3RPk3x0DG3aRdeJlgXiel7sD0/H3U+Tb6ibktVg9k=; b=gh+5JYgmKoyq2tYT8v3UHEfSbe+4sHjM2KZvC8nM/O5AMtjvystv34Fri9UTKr6diX8EsF Pc8KRklCiJInr91pyCstp1wmpVsh/sDTU9l/eVaZm2+ukce+SV3jFUROWB04pDiErVjb9p TcYOJMNzcCryS6HvT7xssevrugCvG2M= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id CA24F13466; Tue, 5 Mar 2024 18:59:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 5z1YMXxr52U3BQAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 18:59:08 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 1/8] btrfs/011: increase the runtime for replace cancel Date: Tue, 5 Mar 2024 19:52:03 +0100 Message-ID: <84c96df7a1fc1fd43e543f0342d46c85b31d4143.1709664047.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=gh+5JYgm X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [3.48 / 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:98:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; 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]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; 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(-0.01)[45.79%] X-Spam-Score: 3.48 X-Rspamd-Queue-Id: D0D9B22A92 X-Spam-Flag: NO From: Josef Bacik This test exercises the btrfs replace cancel path, but in order to do this we have to have enough work to do in order to successfully cancel the balance, otherwise the test fails because the operation has completed before we're able to cancel. This test has a very low pass rate because we do not generate a large enough file system for replace to have enough work, passing around 5% of the time. Increase the time spent to 10x the time we wait for the replace to start its work before we cancel, this allows us to consistently pass this test. Signed-off-by: Josef Bacik --- tests/btrfs/011 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/btrfs/011 b/tests/btrfs/011 index ff52ada94a17d0..d8b5a978275032 100755 --- a/tests/btrfs/011 +++ b/tests/btrfs/011 @@ -60,6 +60,7 @@ wait_time=1 fill_scratch() { local fssize=$1 + local with_cancel=$2 local filler_pid # Fill inline extents. @@ -88,7 +89,11 @@ fill_scratch() $XFS_IO_PROG -f -d -c "pwrite -b 64k 0 1E" "$SCRATCH_MNT/t_filler" &>\ $tmp.filler_result & filler_pid=$! - sleep $((2 * $wait_time)) + if [ "${with_cancel}" = "cancel" ]; then + sleep $((10 * $wait_time)) + else + sleep $((2 * $wait_time)) + fi kill -KILL $filler_pid &> /dev/null wait $filler_pid &> /dev/null @@ -125,7 +130,7 @@ workout() _scratch_mount _require_fs_space $SCRATCH_MNT $((2 * 512 * 1024)) #2.5G - fill_scratch $fssize + fill_scratch $fssize $with_cancel _run_btrfs_util_prog filesystem show -m $SCRATCH_MNT echo -e "Replace from $source_dev to $SPARE_DEV\\n" >> $seqres.full From patchwork Tue Mar 5 18:52:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13582885 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 6F7F624B59; Tue, 5 Mar 2024 18:59:18 +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=1709665160; cv=none; b=jOhA9enyVvlhTHgDm1m5lBcmxiJl1lCARtDL7jsyekSUbhBzlM8vzKoRHkxlq2HDJrsRYwXjYBjUpOcsEqYr8w+oyPc9/5ogt+cD3lXjf5rL+7oYhNuh9K8IMuKfPTraZE+6f1vAZQjxekv3sn0CAtkrXdt0IjkMYHQ4ZKTrLeM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709665160; c=relaxed/simple; bh=/EBrijUi7iFImBEkOH2iUNg/uuOpjavggEz044N7zLw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PJ3/eJKPQnCAmf8LwxtOxf+G3ug182UOVauqRlfRhi+ufcJtpFlt6fL4YEJOAcvpAWbMcPMkHPLqkTR8mTOv6VEaGGttzyY3aMx83c4LpQkLs+Z8GiEBb+cKDJ/FKcqC0kvTUzc4G4Iu8OP5OrjogFromYfarEmok1aR27IB/e8= 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=vRcE29nN; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=vRcE29nN; 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="vRcE29nN"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="vRcE29nN" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 3843934E57; Tue, 5 Mar 2024 18:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665155; 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=TqRZ/Ar6QGLPWQ+QMxyU6AQLlbfPBjk21kd13L0lwOc=; b=vRcE29nNfHs9Nzc9YNWTi6DMARWexAQB3fsSmblS7YoXeXP6cq4kLRDH60H502xX+2fB1x 9iMcPe3p5Yg9gyXL03EHRMZgLpekbaXmBTb25176A1S6Dl3vLGz/9wiRJPJ0Lmmykc+JDW 29g+ZIvTesn+1mFVlD7fp7K/J9JWSSQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665155; 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=TqRZ/Ar6QGLPWQ+QMxyU6AQLlbfPBjk21kd13L0lwOc=; b=vRcE29nNfHs9Nzc9YNWTi6DMARWexAQB3fsSmblS7YoXeXP6cq4kLRDH60H502xX+2fB1x 9iMcPe3p5Yg9gyXL03EHRMZgLpekbaXmBTb25176A1S6Dl3vLGz/9wiRJPJ0Lmmykc+JDW 29g+ZIvTesn+1mFVlD7fp7K/J9JWSSQ= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 31E1613466; Tue, 5 Mar 2024 18:59:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id Yo0rDINr52U+BQAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 18:59:15 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 2/8] btrfs/012: adjust how we populate the fs to convert Date: Tue, 5 Mar 2024 19:52:06 +0100 Message-ID: <0b465808ecd272a04d5ea16383043b91afb6c2b0.1709664047.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; dkim=pass header.d=suse.com header.s=susede1 header.b=vRcE29nN X-Spamd-Result: default: False [1.69 / 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:98:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; 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)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 1.69 X-Rspamd-Queue-Id: 3843934E57 X-Spam-Level: * X-Spam-Flag: NO X-Spamd-Bar: + From: Josef Bacik /lib/modules/$(uname -r)/ can have symlinks to the source tree where the kernel was built from, which can have all sorts of stuff, which will make the runtime for this test exceedingly long. We're just trying to copy some data into our tree to test with, we don't need the entire devel tree of whatever we're doing. Additionally VM's that aren't built with modules will fail this test. Update the test to use /etc, which will always exist. Additionally use timeout just in case there's large files or some other shenanigans so the test doesn't run forever copying large amounts of files. Signed-off-by: Josef Bacik --- tests/btrfs/012 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/btrfs/012 b/tests/btrfs/012 index d9faf81ce1ad8e..7bc0c3ce59d28f 100755 --- a/tests/btrfs/012 +++ b/tests/btrfs/012 @@ -33,6 +33,8 @@ _require_non_zoned_device "${SCRATCH_DEV}" _require_loop _require_extra_fs ext4 +SOURCE_DIR=/etc +BASENAME=$(basename $SOURCE_DIR) BLOCK_SIZE=`_get_block_size $TEST_DIR` # Create & populate an ext4 filesystem @@ -41,9 +43,9 @@ $MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \ # Manual mount so we don't use -t btrfs or selinux context mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT -_require_fs_space $SCRATCH_MNT $(du -s /lib/modules/`uname -r` | ${AWK_PROG} '{print $1}') +_require_fs_space $SCRATCH_MNT $(du -s $SOURCE_DIR | ${AWK_PROG} '{print $1}') -cp -aR /lib/modules/`uname -r`/ $SCRATCH_MNT +timeout 10 cp -aRP $SOURCE_DIR $SCRATCH_MNT _scratch_unmount # Convert it to btrfs, mount it, verify the data @@ -51,7 +53,7 @@ $BTRFS_CONVERT_PROG $SCRATCH_DEV >> $seqres.full 2>&1 || \ _fail "btrfs-convert failed" _try_scratch_mount || _fail "Could not mount new btrfs fs" # (Ignore the symlinks which may be broken/nonexistent) -diff -r /lib/modules/`uname -r`/ $SCRATCH_MNT/`uname -r`/ 2>&1 | grep -vw "source\|build" +diff --no-dereference -r $SOURCE_DIR $SCRATCH_MNT/$BASENAME/ 2>&1 # Old ext4 image file should exist & be consistent $E2FSCK_PROG -fn $SCRATCH_MNT/ext2_saved/image >> $seqres.full 2>&1 || \ @@ -62,12 +64,12 @@ mkdir -p $SCRATCH_MNT/mnt mount -o loop $SCRATCH_MNT/ext2_saved/image $SCRATCH_MNT/mnt || \ _fail "could not loop mount saved ext4 image" # Ignore the symlinks which may be broken/nonexistent -diff -r /lib/modules/`uname -r`/ $SCRATCH_MNT/mnt/`uname -r`/ 2>&1 | grep -vw "source\|build" +diff --no-dereference -r $SOURCE_DIR $SCRATCH_MNT/mnt/$BASENAME/ 2>&1 umount $SCRATCH_MNT/mnt # Now put some fresh data on the btrfs fs mkdir -p $SCRATCH_MNT/new -cp -aR /lib/modules/`uname -r`/ $SCRATCH_MNT/new +timeout 10 cp -aRP $SOURCE_DIR $SCRATCH_MNT/new _scratch_unmount @@ -82,7 +84,7 @@ $E2FSCK_PROG -fn $SCRATCH_DEV >> $seqres.full 2>&1 || \ # Mount the un-converted ext4 device & check the contents mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT # (Ignore the symlinks which may be broken/nonexistent) -diff -r /lib/modules/`uname -r`/ $SCRATCH_MNT/`uname -r`/ 2>&1 | grep -vw "source\|build" +diff --no-dereference -r $SOURCE_DIR $SCRATCH_MNT/$BASENAME/ 2>&1 _scratch_unmount From patchwork Tue Mar 5 18:52:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13582886 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 80D7D250FE; Tue, 5 Mar 2024 18:59: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=1709665161; cv=none; b=GiGG6H68iAIx6Fn2MVOZ6s5/O/9vom5YwoaYEfN9cQrOrQc7VzBf74lC7QlxLNKc5ynXIRpdzLVPDE5GXBmCt6o9meIk8m1Is26cWja6Z+1wYZ7oq2iMNNtHc2ZCHFsvy406P4afkiL6gS1Exrnoq+oasg+yFNdxdAPrdfmhyvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709665161; c=relaxed/simple; bh=LrIOHtg8N/EpGlWKKOL+coje7+xK7gQg0ih+NZ5cj+8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WclUnIw8rJXPIICE0yT3X7X+JLTUF2Zv3eP93L17BIUE7BZbziN5yhk0YeYZ9AFYbABekGwOTBZkJDUMCrWpsoQ7/ufOTV0RRBnOfRZSQtc6qCfKoFMrnTk5zfJJbWA/HwKmV3+OdnYbjj0h6Udsqdqgcf/gk3dVeuueETM0ynU= 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=drihjmYp; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=drihjmYp; 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="drihjmYp"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="drihjmYp" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 8E8C4200FA; Tue, 5 Mar 2024 18:59:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665157; 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=G9TYYLM5/mC98mabg1iwK9lMqDFZeHRXi4ce0skkBV0=; b=drihjmYp3MxzEHVfGQA384quSerwcppihMXH3j1ZT8sJNFD33kLL9+NN+yaNbRQBebBXFa AM+sDRwZVvlRw5J+0eCJbzCt8boO2uP5f1sT8+8TUCM+MgZ9xoMIMrNxFI47D9NbH+SpIY dgszIF/glY06NigQu+c/yBHwRVcUXR0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665157; 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=G9TYYLM5/mC98mabg1iwK9lMqDFZeHRXi4ce0skkBV0=; b=drihjmYp3MxzEHVfGQA384quSerwcppihMXH3j1ZT8sJNFD33kLL9+NN+yaNbRQBebBXFa AM+sDRwZVvlRw5J+0eCJbzCt8boO2uP5f1sT8+8TUCM+MgZ9xoMIMrNxFI47D9NbH+SpIY dgszIF/glY06NigQu+c/yBHwRVcUXR0= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 88A4513466; Tue, 5 Mar 2024 18:59:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id eldaIYVr52VDBQAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 18:59:17 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 3/8] btrfs/131: don't run with subpage blocksizes Date: Tue, 5 Mar 2024 19:52:12 +0100 Message-ID: <3f9c8b6a7ac5b9286999a725a53d6cca55d9a74e.1709664047.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; dkim=pass header.d=suse.com header.s=susede1 header.b=drihjmYp X-Spamd-Result: default: False [2.74 / 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:98:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; 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)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-1.95)[94.76%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 2.74 X-Rspamd-Queue-Id: 8E8C4200FA X-Spam-Level: ** X-Spam-Flag: NO X-Spamd-Bar: ++ From: Josef Bacik This test requires a feature that is incompatible with subpage blocksizes. Check to see if that's what we're testing and simply skip this test. Signed-off-by: Josef Bacik --- tests/btrfs/131 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/btrfs/131 b/tests/btrfs/131 index 1e072b285ecfea..529ee3e80f87eb 100755 --- a/tests/btrfs/131 +++ b/tests/btrfs/131 @@ -21,6 +21,10 @@ _require_btrfs_fs_feature free_space_tree # Zoned btrfs does not support space_cache(v1) _require_non_zoned_device "${SCRATCH_DEV}" +_scratch_mkfs >/dev/null 2>&1 +[ "$(_get_page_size)" -gt "$(_scratch_btrfs_sectorsize)" ] && \ + _notrun "cannot run with subpage sectorsize" + mkfs_v1() { _scratch_mkfs >/dev/null 2>&1 From patchwork Tue Mar 5 18:52:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13582887 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 50C95288DB; Tue, 5 Mar 2024 18:59: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=1709665164; cv=none; b=lsyKLLN/4qiO2kw9bPngj+98wJhLMqQSKlopoVtS8HmgvkbVFAqluA0dvzmx/rg+pbG4W8GuvV/9/9cvvZ+5TQpkpqw0icwxw7e4coTB+qRMQe4DJcQhi89KGgCHA4UIaC7v2R6+6UAnZustqDvg/g/XTB+hgOf4nkmr++luRMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709665164; c=relaxed/simple; bh=aKC90b+tRFJe40ZXBUd7pbHxaxHmvbobfQtECX49514=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ufpl8PFoV8O82T7oTvUuOBdXrstiGPxJKDAwkzdi/O6Gu68/uRL/NVjyy/h6Xd59RsFWuGjDWzSi2rO+v8bYCKHaC+9b3v37ro+X2+0L3cT3tlWrEu+mXx95z+Vxorgi7m8FGuPPI6PlftKGNuVG3KGrKtmKdpmZeCsx0EqWD14= 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=bYYY3Xom; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=HKQ6QFAE; 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="bYYY3Xom"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="HKQ6QFAE" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 E79BF20DE2; Tue, 5 Mar 2024 18:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665160; 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=4wkOYl4lSaUAz6/c69SQ5WVIIwo8oth+q0Ufe8kbPr4=; b=bYYY3Xomie+C8W6OkA/XbOLU2FKLynV6cSlxjkbB5Rxe9w30vIECuNNnzWgfOvcR/NfGzR OiWJ33GU3o21aEnLSvA8ImXVn+Xh4SdYumg63AHmLxA4ia03d3guHKxFppKnvyowgWrjYm WJMAzheQzylqZ1Thw4sflRC5rsVUw/o= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665159; 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=4wkOYl4lSaUAz6/c69SQ5WVIIwo8oth+q0Ufe8kbPr4=; b=HKQ6QFAEHyLBXu5yJJls6njqSzZH9xccy88pGdH+qoeBzPHkdDdl58ePFCcXUUR8YYMjGL dhy6FXs+1Am7qYBw717qCKvIcNoae3SytaL6cDt1hnZtLfIbuDwzoDSLnwZDi4oXcryBkG vp3E3YBYgfFqSOZffOy73lyMVbYZ23o= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id E22B113466; Tue, 5 Mar 2024 18:59:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id jbg1N4dr52VGBQAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 18:59:19 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 4/8] btrfs/213: make the test more reliable Date: Tue, 5 Mar 2024 19:52:14 +0100 Message-ID: <2349210f22271d849bd835e49cec946aca7c86ed.1709664047.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-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=HKQ6QFAE 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:98:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; 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]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; 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: E79BF20DE2 X-Spam-Flag: NO From: Josef Bacik This test will write for 8 seconds and then try to balance, but for some setups 8 seconds may be enough to fill the disk. Instead figure out what half the size of the disk is and write at most that many bytes, or for 8 seconds, whichever comes first. Then use the amount of time it took to do the write to determine how long we should allow the balance to continue before we attempt to cancel it. Additionally the macro is '_notrun' not '_not_run'. With this change this test now does the correct thing on my ARM CI VM. Signed-off-by: Josef Bacik --- check | 6 ------ common/rc | 5 +++++ tests/btrfs/213 | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/check b/check index 71b9fbd075223f..c6dba89b5b506e 100755 --- a/check +++ b/check @@ -204,12 +204,6 @@ trim_test_list() rm -f $tmp.grep } - -_wallclock() -{ - date "+%s" -} - _timestamp() { local now=`date "+%T"` diff --git a/common/rc b/common/rc index 6cbceb7ae7c6bb..9b6dfcaaeddadb 100644 --- a/common/rc +++ b/common/rc @@ -6,6 +6,11 @@ BC="$(type -P bc)" || BC= +_wallclock() +{ + date "+%s" +} + _require_math() { if [ -z "$BC" ]; then diff --git a/tests/btrfs/213 b/tests/btrfs/213 index 6def4f6ef79acf..816041a0cc2ea0 100755 --- a/tests/btrfs/213 +++ b/tests/btrfs/213 @@ -31,23 +31,23 @@ _fixed_by_kernel_commit 1dae7e0e58b4 \ _scratch_mkfs >> $seqres.full _scratch_mount -runtime=8 +max_space=$(_get_total_space $SCRATCH_MNT) +max_space=$(( max_space / 2 )) -# Create enough IO so that we need around $runtime seconds to relocate it. -# -# Here we don't want any wrapper, as we want full control of the process. -$XFS_IO_PROG -f -c "pwrite -D -b 1M 0 1024T" "$SCRATCH_MNT/file" &> /dev/null & -write_pid=$! -sleep $runtime -kill $write_pid -wait $write_pid +# Create enough IO so that we need around 8 seconds to relocate it. +start_ts=$(_wallclock) +$TIMEOUT_PROG 8s $XFS_IO_PROG -f -c "pwrite -D -b 1M 0 $max_space" \ + "$SCRATCH_MNT/file" > /dev/null 2>&1 +stop_ts=$(_wallclock) + +runtime=$(( stop_ts - start_ts )) # Unmount and mount again the fs to clear any cached data and metadata, so that # it's less likely balance has already finished when we try to cancel it below. _scratch_cycle_mount # Now balance should take at least $runtime seconds, we can cancel it at -# $runtime/2 to ensure a success cancel. +# $runtime/4 to ensure a success cancel. _run_btrfs_balance_start -d --bg "$SCRATCH_MNT" sleep $(($runtime / 4)) # It's possible that balance has already completed. It's unlikely but often From patchwork Tue Mar 5 18:52:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13582888 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 5E5B124215; Tue, 5 Mar 2024 18:59:24 +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=1709665166; cv=none; b=aoK+xzo63Ng6/0E1Vjiyi/G+PMsI5pJD+9KQFc+hnGr2AgmhRhG/k4hiAdE152VIPUFE016rCGKwDfr65dAcCM49M4PpJWEtBLBU1MaF6XOTFWRmvOMlAfDztvZHeFOqNiQ0sH0VDk+0uw2V/Mbyr5SKUd6gLgj72Licxhvjroc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709665166; c=relaxed/simple; bh=1QNPzpCEThC3pw2m27TmJdYNtpdPz/TKCUxbFvH6nm8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eQePhi7bDrJlGn1M0rInoIfmqjQybEr0zsET0+2WLlb0n+mjFWKcdNtZnT/HVy85JzQlfesTwU0hQcwEX+c1qZldcQY4AQtDYv8IEhti6pxJNOpQKZl/D/vgHViehBZg7Gk6Y5cdM01KV08+KxbiAoYyL4HvEb1pGvQU7eBIkwM= 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=ZODoZRLG; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=ZODoZRLG; 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="ZODoZRLG"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="ZODoZRLG" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 4B8853486D; Tue, 5 Mar 2024 18:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665162; 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=iThOjI4NuMlFaoLbKj6b9vac+2kfp+VxdCRC0NY9Hbc=; b=ZODoZRLGAnRoFgQmuPiZJ+w0qJG9z/0AREuYoHdlUAv+EehQtZ/T8r/QAooIVHtcw9NP7M GAM0yeMaRuEwO+M17uXWZXaLxP/Hkdd7bS0jmKKnkx3kGPq+CO/3F27PBOOZINW+mlPjpF LnAlcXQMZn01Ydlbe4cYFHyzvsNnsaM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665162; 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=iThOjI4NuMlFaoLbKj6b9vac+2kfp+VxdCRC0NY9Hbc=; b=ZODoZRLGAnRoFgQmuPiZJ+w0qJG9z/0AREuYoHdlUAv+EehQtZ/T8r/QAooIVHtcw9NP7M GAM0yeMaRuEwO+M17uXWZXaLxP/Hkdd7bS0jmKKnkx3kGPq+CO/3F27PBOOZINW+mlPjpF LnAlcXQMZn01Ydlbe4cYFHyzvsNnsaM= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 45C1713466; Tue, 5 Mar 2024 18:59:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id lMoFEYpr52VJBQAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 18:59:22 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 5/8] btrfs/271: adjust failure condition Date: Tue, 5 Mar 2024 19:52:17 +0100 Message-ID: <9c31107be9800792b528614e57b075d7e76010b9.1709664047.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=ZODoZRLG 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:98:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; 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]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; 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: 4B8853486D X-Spam-Flag: NO From: Josef Bacik btrfs/271 was failing with the subpage blocksize VM's. This is because there's an assumption made that the device error counters are per-sector, but they're per-io. With a 16kib pagesize and a 4k sectorsize/nodesize the threshold was expecting 16 failed IO's, but instead we were getting 5. This other gotcha here is that with the tree log we will write the log tree first, and then update the log root tree with the location of the log tree root node. With pagesize == nodesize this is fine, we will only write the log tree root node. However with subpage blocksize both of these nodes could be on the same page, and thus they are both written out during that initial write. When we update the pointer for the log root tree we will COW the log root tree root node and submit another IO, resulting in 3 metadata IO's instead of 2. Fix the failure case to be < 4 blocks, which is the minimum number of IO's we should be seeing. Signed-off-by: Josef Bacik --- tests/btrfs/271 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/btrfs/271 b/tests/btrfs/271 index 273799f17924c0..a342af3aed44cf 100755 --- a/tests/btrfs/271 +++ b/tests/btrfs/271 @@ -25,10 +25,6 @@ _scratch_mount dev2=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'` -pagesize=$(_get_page_size) -blocksize=$(_get_block_size $SCRATCH_MNT) -sectors_per_page=$(($pagesize / $blocksize)) - _allow_fail_make_request echo "Step 1: writing with one failing mirror:" @@ -36,9 +32,14 @@ _bdev_fail_make_request $SCRATCH_DEV 1 $XFS_IO_PROG -f -c "pwrite -W -S 0xaa 0 8K" $SCRATCH_MNT/foobar | _filter_xfs_io _bdev_fail_make_request $SCRATCH_DEV 0 +# btrfs counts errors per IO, assuming the data is merged that'll be 1 IO, then +# the log tree block and then the log root tree block and then the super block. +# We should see at least 4 failed IO's, but with subpage blocksize we could see +# more if the log blocks end up on the same page, or if the data IO gets split +# at all. errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | \ $AWK_PROG '/write_io_errs/ { print $2 }') -if [ $errs -ne $((4 * $sectors_per_page)) ]; then +if [ $errs -lt 4 ]; then _fail "Errors: $errs expected: 4" fi From patchwork Tue Mar 5 18:52:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13582889 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 83C3438FA7; Tue, 5 Mar 2024 18:59: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=1709665168; cv=none; b=XbKqdX/yMF8HCgTeio/xrECjrrD2Q6yfFXyYAu6+oqmKa7KrN3XAIJ067B2Sicg7KxYUJgZhsgkJccqluNnAkhbWPDIQBtT5kCfCvEvP8upJ5a1Or7bSz1wHd7RDjdgbuOACekm7GWh/501hq8lJIV05s5EzcKxH+jm6Zj/mDBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709665168; c=relaxed/simple; bh=uXy49FmSUgS9BMA4Ys2k/M2JSB+LVAwPuyKKWGmddtc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ndWfa6OrWQDONUd1Hcfiq5aHy2RuAiVsGmMXLel9Fj8AdoJWmNQ91PVa4qw8uvBL1aCJmvYPINixT6gH9/DyMzHiFRqqfnhKI8IzFoxIbh3qlWuslxAzHI3GFDBJuKI/L3BDTfQOrRIKbDKZfKgcMOvICDsnvymozId4uaPfWMM= 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=tfOjBT+K; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=tfOjBT+K; 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="tfOjBT+K"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="tfOjBT+K" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 A27CA34B4C; Tue, 5 Mar 2024 18:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665164; 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=NX7rQq9PbMxqQobfWnBcl7rA1Sz6+kv4X/IrxAs9zIg=; b=tfOjBT+KLlZwwLVYLQDy1ToJsFUpKIEaygNSKC/rcQV/BHwt1zIJb9juQR6BBf55tBv8yr rgnkLvFAmcY7NbatzP/RBKUQg8XHGQtNtAf5f8eg3t5lhKlAYTrEKmmFH1kOTeXZtpwCKe 5hrGYVabylx6aPflYzFzP+fLPFwQ2KE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665164; 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=NX7rQq9PbMxqQobfWnBcl7rA1Sz6+kv4X/IrxAs9zIg=; b=tfOjBT+KLlZwwLVYLQDy1ToJsFUpKIEaygNSKC/rcQV/BHwt1zIJb9juQR6BBf55tBv8yr rgnkLvFAmcY7NbatzP/RBKUQg8XHGQtNtAf5f8eg3t5lhKlAYTrEKmmFH1kOTeXZtpwCKe 5hrGYVabylx6aPflYzFzP+fLPFwQ2KE= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 9C76713466; Tue, 5 Mar 2024 18:59:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 4/MwJoxr52VLBQAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 18:59:24 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 6/8] btrfs/287,btrfs/293: filter all btrfs subvolume delete calls Date: Tue, 5 Mar 2024 19:52:19 +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-out1.suse.de; none X-Spam-Level: X-Spam-Score: 0.70 X-Spamd-Result: default: False [0.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; 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)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Flag: NO From: Josef Bacik Some of our btrfs subvolume delete calls get put into the golden output, and many of them simply _filter_scratch. This works fine, but we recently changed btrfs subvolume delete output, and it would have been nice to simply filter this in one place. We have a _filter_btrfs_subvol_delete helper, but it's only used in one place. Fix all of these uses to call _filter_btrfs_subvol_delete, this will allow for follow up fixes against _filter_btrfs_subvol_delete itself to deal with changed output. Signed-off-by: Josef Bacik --- tests/btrfs/287 | 4 ++-- tests/btrfs/287.out | 2 +- tests/btrfs/293 | 6 +++--- tests/btrfs/293.out | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/btrfs/287 b/tests/btrfs/287 index 04871d46036aa2..64e6ef35250c8e 100755 --- a/tests/btrfs/287 +++ b/tests/btrfs/287 @@ -9,7 +9,7 @@ . ./common/preamble _begin_fstest auto quick snapshot clone punch logical_resolve -. ./common/filter +. ./common/filter.btrfs . ./common/reflink _supported_fs btrfs @@ -148,7 +148,7 @@ echo "resolve second extent with ignore offset option:" query_logical_ino -o $second_extent_bytenr | filter_snapshot_ids # Now delete the first snapshot and repeat the last 2 queries. -$BTRFS_UTIL_PROG subvolume delete -C $SCRATCH_MNT/snap1 | _filter_scratch +$BTRFS_UTIL_PROG subvolume delete -C $SCRATCH_MNT/snap1 | _filter_btrfs_subvol_delete # Query the second extent with an offset of 0, should return file offsets 12M # and 20M for the default subvolume (root 5) and file offsets 4M, 12M and 20M diff --git a/tests/btrfs/287.out b/tests/btrfs/287.out index 0d69473364fa31..30eac8fa444c8f 100644 --- a/tests/btrfs/287.out +++ b/tests/btrfs/287.out @@ -79,7 +79,7 @@ inode 257 offset 4194304 snap1 inode 257 offset 20971520 root 5 inode 257 offset 12582912 root 5 inode 257 offset 5242880 root 5 -Delete subvolume (commit): 'SCRATCH_MNT/snap1' +Delete subvolume 'SCRATCH_MNT/snap1' resolve second extent: inode 257 offset 20971520 snap2 inode 257 offset 12582912 snap2 diff --git a/tests/btrfs/293 b/tests/btrfs/293 index cded956468ee9a..06f96dc414b05b 100755 --- a/tests/btrfs/293 +++ b/tests/btrfs/293 @@ -18,7 +18,7 @@ _cleanup() test -n "$swap_file" && swapoff $swap_file &> /dev/null } -. ./common/filter +. ./common/filter.btrfs _supported_fs btrfs _fixed_by_kernel_commit deccae40e4b3 \ @@ -40,7 +40,7 @@ echo "Activating swap file... (should fail due to snapshots)" _swapon_file $swap_file 2>&1 | _filter_scratch echo "Deleting first snapshot..." -$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap1 | _filter_scratch +$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap1 | _filter_btrfs_subvol_delete # We deleted the snapshot and committed the transaction used to delete it (-c), # but all its extents are actually only deleted in the background, by the cleaner @@ -55,7 +55,7 @@ echo "Activating swap file... (should fail due to snapshot)" _swapon_file $swap_file 2>&1 | _filter_scratch echo "Deleting second snapshot..." -$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap2 | _filter_scratch +$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap2 | _filter_btrfs_subvol_delete echo "Remounting and waiting for cleaner thread to remove the second snapshot..." _scratch_remount commit=1 diff --git a/tests/btrfs/293.out b/tests/btrfs/293.out index 2ac1663281947a..fd04ac9139b849 100644 --- a/tests/btrfs/293.out +++ b/tests/btrfs/293.out @@ -6,12 +6,12 @@ Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2' Activating swap file... (should fail due to snapshots) swapon: SCRATCH_MNT/swapfile: swapon failed: Invalid argument Deleting first snapshot... -Delete subvolume (commit): 'SCRATCH_MNT/snap1' +Delete subvolume 'SCRATCH_MNT/snap1' Remounting and waiting for cleaner thread to remove the first snapshot... Activating swap file... (should fail due to snapshot) swapon: SCRATCH_MNT/swapfile: swapon failed: Invalid argument Deleting second snapshot... -Delete subvolume (commit): 'SCRATCH_MNT/snap2' +Delete subvolume 'SCRATCH_MNT/snap2' Remounting and waiting for cleaner thread to remove the second snapshot... Activating swap file... Disabling swap file... From patchwork Tue Mar 5 18:52:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13582890 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 DC2CD1426F; Tue, 5 Mar 2024 18:59:32 +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=1709665174; cv=none; b=Pm/SGOgr/vBzsr1LbqL1WbROFxDWjGTxNPDZ/WT6aM3xq6WDbJWLWgYSCgy6Y4ucCHJZbU+I9T8r1MQSJgGiG7u1aqcPW9uTS/nCW3A0879eas3w2LXyX3VEPoM/1PP65bXPEba/xqFOYd8INSAGrBd3E5q2dsi/ovMypQSYFFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709665174; c=relaxed/simple; bh=eBrVNw/7RDH4IpC2Fh0sHri8bnCHqBFkU5ohnmhIpAI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AV2hOQfx86UDrDjMByrcFpJvKuukTH7aptCdCR2Ukpjlr9wGOaJf6eFWTnvs6idgg7stOSdxza734evNuyPV+Sz1u3FpyIeZv1RwMyKE4LStkC+PDvioJwRn0jgz2obI8fUXiH/XFhv1RqgSrPboFtu0ac+knX7/AjNGIgs4m18= 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=O/zZO0Ck; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=O/zZO0Ck; 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="O/zZO0Ck"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="O/zZO0Ck" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 089C75BFEA; Tue, 5 Mar 2024 18:59:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665167; 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=4namxjqkGOrU39sN8Z00UgoTwnohx8omcDJ2Y7zZyX0=; b=O/zZO0Cku/aE+YnDXbHPX3Xh3qPfIgqjLyVpBvOIQ08mGql03zRcXsZu6w/cPMTojCGjhQ YsLBF2Q22ViA8AevlugGI9civPmRGnFWv1d62DQEiiU4LRGr4dg/YiqZaqCjYGdf65tG8Z ONw7NdnLU0MqAVhaXKZwPzUuQlUA3lU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665167; 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=4namxjqkGOrU39sN8Z00UgoTwnohx8omcDJ2Y7zZyX0=; b=O/zZO0Cku/aE+YnDXbHPX3Xh3qPfIgqjLyVpBvOIQ08mGql03zRcXsZu6w/cPMTojCGjhQ YsLBF2Q22ViA8AevlugGI9civPmRGnFWv1d62DQEiiU4LRGr4dg/YiqZaqCjYGdf65tG8Z ONw7NdnLU0MqAVhaXKZwPzUuQlUA3lU= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 02EAC13466; Tue, 5 Mar 2024 18:59:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id Lxm0AI9r52VNBQAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 18:59:27 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 7/8] btrfs/291: remove image file after teardown Date: Tue, 5 Mar 2024 19:52:22 +0100 Message-ID: <096e64b057469f65b6f2e36f5d96680235889273.1709664047.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; dkim=pass header.d=suse.com header.s=susede1 header.b="O/zZO0Ck" X-Spamd-Result: default: False [4.66 / 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:98:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; 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)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.03)[56.49%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.66 X-Rspamd-Queue-Id: 089C75BFEA X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ From: Josef Bacik LVM doesn't like it when you remove the file out from underneath the backing device. Signed-off-by: Josef Bacik --- tests/btrfs/291 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/btrfs/291 b/tests/btrfs/291 index c5947133239940..bfffb845fea740 100755 --- a/tests/btrfs/291 +++ b/tests/btrfs/291 @@ -20,9 +20,9 @@ _cleanup() { cd / _log_writes_cleanup &> /dev/null - rm -f $img $LVM_PROG vgremove -f -y $vgname >>$seqres.full 2>&1 losetup -d $loop_dev >>$seqres.full 2>&1 + rm -f $img _restore_fsverity_signatures } From patchwork Tue Mar 5 18:52:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 13582891 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 62E631BC26; Tue, 5 Mar 2024 18:59:33 +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=1709665175; cv=none; b=IJec0boMkrtq7K6bHh+5y293TtrKO9i+cCjK0//tHl/hucHzxLW9vw4ZbEFo6odqK8z0CaJzXYm0huf0wXmvVt0dmK1C/J8GJJhBEGIkOQXGQJo+8dMPHAZry6mpYCQ1y8hksTfjAwn3MbTNK4SjGyWjQn7x6BGsRDyFYuST3TY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709665175; c=relaxed/simple; bh=bEPViQRIALUwLRmHbD4kPtiF/bNpw/Bj6eDl1xFqdsc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bUx3JV0n17NE6EEhj4PUpDaAhBdhYdxWHSg+80OOXBaplEAC7xwt3AbkNb6GQtPC2oqanK3/aJbynEKEHaxKA9YzCHxrkzmk1af1dg4utjVurZbTFkPDqPf4/1Jq9/LoaeFM8DGIHHZHJpwXnOZ0ngZuM1WuVefMcuR2bK7Y3rE= 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=oHGVpTYT; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=oHGVpTYT; 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="oHGVpTYT"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="oHGVpTYT" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 65CC134B4C; Tue, 5 Mar 2024 18:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665169; 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=2vKSPm1DbA2X+OhDsfsV30BH30GefQh7qeubHQ5HUhI=; b=oHGVpTYTx8t2V+TeY7aPmR0fIevyZx6Ex424561POCvjJ9jXUSkBYE7M1pHfC8ryC2Oj3J jNMS64RTV36npt+8tiT6xnfLF34J2GG9wnt3qmmJmJivvGzbimd996rOG+CbRmRFlBXLMl veqbOwsFryBbAkDdLE4xHG8Q+Xw775Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709665169; 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=2vKSPm1DbA2X+OhDsfsV30BH30GefQh7qeubHQ5HUhI=; b=oHGVpTYTx8t2V+TeY7aPmR0fIevyZx6Ex424561POCvjJ9jXUSkBYE7M1pHfC8ryC2Oj3J jNMS64RTV36npt+8tiT6xnfLF34J2GG9wnt3qmmJmJivvGzbimd996rOG+CbRmRFlBXLMl veqbOwsFryBbAkDdLE4xHG8Q+Xw775Q= Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 5F4E613466; Tue, 5 Mar 2024 18:59:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 4ApBF5Fr52VQBQAAn2gu4w (envelope-from ); Tue, 05 Mar 2024 18:59:29 +0000 From: David Sterba To: fstests@vger.kernel.org Cc: Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH 8/8] btrfs/400: test normal qgroup operations in a compress friendly way Date: Tue, 5 Mar 2024 19:52:24 +0100 Message-ID: <7d8ea24daf7f62ff620f8ebca9e81aa9d6021d01.1709664047.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; dkim=pass header.d=suse.com header.s=susede1 header.b=oHGVpTYT X-Spamd-Result: default: False [1.69 / 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:98:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; 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)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 1.69 X-Rspamd-Queue-Id: 65CC134B4C X-Spam-Level: * X-Spam-Flag: NO X-Spamd-Bar: + From: Josef Bacik btrfs/022 currently fails if you are testing with -o compress because it does a limit exceed test which will pass with compression on. However the other functionality this test tests is completely acceptable with compression enabled. Handle this by breaking the test into two tests, one that simply tests the qgroup exceed limits test that requires no compression, and the rest of the tests that do not have the no compression restriction. Signed-off-by: Josef Bacik --- tests/btrfs/022 | 86 ++--------------------------------- tests/btrfs/400 | 107 ++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/400.out | 2 + 3 files changed, 112 insertions(+), 83 deletions(-) create mode 100755 tests/btrfs/400 create mode 100644 tests/btrfs/400.out diff --git a/tests/btrfs/022 b/tests/btrfs/022 index b1ef2fdf787640..32ad80bf9c64e8 100755 --- a/tests/btrfs/022 +++ b/tests/btrfs/022 @@ -4,7 +4,7 @@ # # FS QA Test No. 022 # -# Test the basic functionality of qgroups +# Test the basic qgroup exceed case # . ./common/preamble _begin_fstest auto qgroup limit @@ -17,59 +17,8 @@ _require_scratch _require_qgroup_rescan _require_btrfs_qgroup_report -# Test to make sure we can actually turn it on and it makes sense -_basic_test() -{ - echo "=== basic test ===" >> $seqres.full - _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a - _run_btrfs_util_prog quota enable $SCRATCH_MNT/a - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT - subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) - $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \ - $seqres.full 2>&1 - [ $? -eq 0 ] || _fail "couldn't find our subvols quota group" - run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \ - $FSSTRESS_AVOID - _run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT/a \ - $SCRATCH_MNT/b - - # the shared values of both the original subvol and snapshot should - # match - a_shared=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") - a_shared=$(echo $a_shared | $AWK_PROG '{ print $2 }') - echo "subvol a id=$subvolid" >> $seqres.full - subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT b) - echo "subvol b id=$subvolid" >> $seqres.full - b_shared=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") - b_shared=$(echo $b_shared | $AWK_PROG '{ print $2 }') - $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT >> $seqres.full - [ $b_shared -eq $a_shared ] || _fail "shared values don't match" -} - -#enable quotas, do some work, check our values and then rescan and make sure we -#come up with the same answer -_rescan_test() -{ - echo "=== rescan test ===" >> $seqres.full - # first with a blank subvol - _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a - _run_btrfs_util_prog quota enable $SCRATCH_MNT/a - subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) - run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \ - $FSSTRESS_AVOID - sync - output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") - echo "qgroup values before rescan: $output" >> $seqres.full - refer=$(echo $output | $AWK_PROG '{ print $2 }') - excl=$(echo $output | $AWK_PROG '{ print $3 }') - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT - output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") - echo "qgroup values after rescan: $output" >> $seqres.full - [ $refer -eq $(echo $output | $AWK_PROG '{ print $2 }') ] || \ - _fail "reference values don't match after rescan" - [ $excl -eq $(echo $output | $AWK_PROG '{ print $3 }') ] || \ - _fail "exclusive values don't match after rescan" -} +# This test requires specific data usage, skip if we have compression enabled +_require_no_compress #basic exceed limit testing _limit_test_exceed() @@ -82,43 +31,14 @@ _limit_test_exceed() _ddt of=$SCRATCH_MNT/a/file bs=10M count=1 >> $seqres.full 2>&1 [ $? -ne 0 ] || _fail "quota should have limited us" } - -#basic noexceed limit testing -_limit_test_noexceed() -{ - echo "=== limit not exceed test ===" >> $seqres.full - _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a - _run_btrfs_util_prog quota enable $SCRATCH_MNT - subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) - _run_btrfs_util_prog qgroup limit 5M 0/$subvolid $SCRATCH_MNT - _ddt of=$SCRATCH_MNT/a/file bs=4M count=1 >> $seqres.full 2>&1 - [ $? -eq 0 ] || _fail "should have been allowed to write" -} - units=`_btrfs_qgroup_units` -_scratch_mkfs > /dev/null 2>&1 -_scratch_mount -_basic_test -_scratch_unmount -_check_scratch_fs - -_scratch_mkfs > /dev/null 2>&1 -_scratch_mount -_rescan_test -_scratch_unmount -_check_scratch_fs - _scratch_mkfs > /dev/null 2>&1 _scratch_mount _limit_test_exceed _scratch_unmount _check_scratch_fs -_scratch_mkfs > /dev/null 2>&1 -_scratch_mount -_limit_test_noexceed - # success, all done echo "Silence is golden" status=0 diff --git a/tests/btrfs/400 b/tests/btrfs/400 new file mode 100755 index 00000000000000..ad0363fb72d186 --- /dev/null +++ b/tests/btrfs/400 @@ -0,0 +1,107 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2021 Facebook. All Rights Reserved. +# +# FS QA Test No. 400 +# +# Test qgroups to validate the creation works, the counters are sane, rescan +# works, and we do not get failures when we write less than the limit amount. +# +. ./common/preamble +_begin_fstest auto qgroup limit + +# Import common functions. +. ./common/filter + +_supported_fs btrfs +_require_scratch +_require_btrfs_qgroup_report + +# Test to make sure we can actually turn it on and it makes sense +_basic_test() +{ + echo "=== basic test ===" >> $seqres.full + _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a + _run_btrfs_util_prog quota enable $SCRATCH_MNT/a + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) + $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \ + $seqres.full 2>&1 + [ $? -eq 0 ] || _fail "couldn't find our subvols quota group" + run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \ + $FSSTRESS_AVOID + _run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT/a \ + $SCRATCH_MNT/b + + # the shared values of both the original subvol and snapshot should + # match + a_shared=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") + a_shared=$(echo $a_shared | $AWK_PROG '{ print $2 }') + echo "subvol a id=$subvolid" >> $seqres.full + subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT b) + echo "subvol b id=$subvolid" >> $seqres.full + b_shared=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") + b_shared=$(echo $b_shared | $AWK_PROG '{ print $2 }') + $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT >> $seqres.full + [ $b_shared -eq $a_shared ] || _fail "shared values don't match" +} + +#enable quotas, do some work, check our values and then rescan and make sure we +#come up with the same answer +_rescan_test() +{ + echo "=== rescan test ===" >> $seqres.full + # first with a blank subvol + _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a + _run_btrfs_util_prog quota enable $SCRATCH_MNT/a + subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) + run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \ + $FSSTRESS_AVOID + sync + output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") + echo "qgroup values before rescan: $output" >> $seqres.full + refer=$(echo $output | $AWK_PROG '{ print $2 }') + excl=$(echo $output | $AWK_PROG '{ print $3 }') + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") + echo "qgroup values after rescan: $output" >> $seqres.full + [ $refer -eq $(echo $output | $AWK_PROG '{ print $2 }') ] || \ + _fail "reference values don't match after rescan" + [ $excl -eq $(echo $output | $AWK_PROG '{ print $3 }') ] || \ + _fail "exclusive values don't match after rescan" +} + +#basic noexceed limit testing +_limit_test_noexceed() +{ + echo "=== limit not exceed test ===" >> $seqres.full + _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a + _run_btrfs_util_prog quota enable $SCRATCH_MNT + subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) + _run_btrfs_util_prog qgroup limit 5M 0/$subvolid $SCRATCH_MNT + _ddt of=$SCRATCH_MNT/a/file bs=4M count=1 >> $seqres.full 2>&1 + [ $? -eq 0 ] || _fail "should have been allowed to write" +} + +units=`_btrfs_qgroup_units` + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount +_basic_test +_scratch_unmount +_check_scratch_fs + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount +_rescan_test +_scratch_unmount +_check_scratch_fs + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount +_limit_test_noexceed + +# success, all done +echo "Silence is golden" +status=0 +exit diff --git a/tests/btrfs/400.out b/tests/btrfs/400.out new file mode 100644 index 00000000000000..c940c6206bcd81 --- /dev/null +++ b/tests/btrfs/400.out @@ -0,0 +1,2 @@ +QA output created by 400 +Silence is golden