From patchwork Wed Nov 9 16:44:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 13037731 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52B85C4332F for ; Wed, 9 Nov 2022 16:45:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbiKIQpI (ORCPT ); Wed, 9 Nov 2022 11:45:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbiKIQpG (ORCPT ); Wed, 9 Nov 2022 11:45:06 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9F241FCC7; Wed, 9 Nov 2022 08:45:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 732AF61B9C; Wed, 9 Nov 2022 16:45:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1971AC433C1; Wed, 9 Nov 2022 16:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668012304; bh=TwISZ/nzIRTyL2L5TzItZDMk/yrP1vq2gi0CtQk4l20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UxXVX/VCXziwDL4Mrm2uSuJ50XGMYt5p5ZiulGEmbmiMsRz6DqZRJWb0VmE2GBp04 UpS7zAKA8saQ6AyeCSQAy4b/GHl2aDE2Qmvfp/ucW53eph2NVRQlz9GC77SC1FXhyp WZevo+jc6lrLsvkud1IxnyKJeXMAXU6b7yr+Bji8zpSPC9F3rqj9e5U53Efuvzh5pJ M7uOaaoEVuFWPxPGCn9Y45QUQsufLMczhPdEJH8bVilc7A32zcYKZ+O6qm0+Tn+efK Sx66KPQy07H039WoIHPELNBsZMAoxx8/0EoZY3ygNZPGSINRq08gVi6MKxvQySA5Xn r9Zq5CiOl0SGA== From: fdmanana@kernel.org To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, Filipe Manana Subject: [PATCH v2 1/3] btrfs/003: fix failure on new btrfs-progs versions Date: Wed, 9 Nov 2022 16:44:56 +0000 Message-Id: <62ef22111c9cb654e6e5e50f7337105b9ef804d7.1668011769.git.fdmanana@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Filipe Manana Starting with btrfs-progs version 5.19, the output of 'filesystem show' command changed when we have a missing device. The old output was like the following: Label: none uuid: 139ef309-021f-4b98-a3a8-ce230a83b1e2 Total devices 2 FS bytes used 128.00KiB devid 1 size 5.00GiB used 1.26GiB path /dev/loop0 *** Some devices missing While the new output (btrfs-progs 5.19+) is like the following: Label: none uuid: 4a85a40b-9b79-4bde-8e52-c65a550a176b Total devices 2 FS bytes used 128.00KiB devid 1 size 5.00GiB used 1.26GiB path /dev/loop0 devid 2 size 0 used 0 path /dev/loop1 MISSING More specifically it happened in the following btrfs-progs commit: 957a79c9b016 ("btrfs-progs: fi show: print missing device for a mounted file system") This is making btrfs/003 fail with btrfs-progs 5.19+. Update the grep filter in btrfs/003 so that it works with both output formats. Signed-off-by: Filipe Manana Reviewed-by: Qu Wenruo --- tests/btrfs/003 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/btrfs/003 b/tests/btrfs/003 index cf605730..fae6d9d1 100755 --- a/tests/btrfs/003 +++ b/tests/btrfs/003 @@ -141,8 +141,9 @@ _test_replace() _devmgt_remove ${removed_dev_htl} $ds dev_removed=1 - $BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV | grep "Some devices missing" >> $seqres.full || _fail \ - "btrfs did not report device missing" + $BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV | \ + grep -ie '\bmissing\b' >> $seqres.full || \ + _fail "btrfs did not report device missing" # add a new disk to btrfs ds=${devs[@]:$(($n)):1} From patchwork Wed Nov 9 16:44:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 13037732 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8588FC43219 for ; Wed, 9 Nov 2022 16:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230118AbiKIQpJ (ORCPT ); Wed, 9 Nov 2022 11:45:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbiKIQpI (ORCPT ); Wed, 9 Nov 2022 11:45:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DDDA26CE; Wed, 9 Nov 2022 08:45:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A1EFE61965; Wed, 9 Nov 2022 16:45:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A985C433B5; Wed, 9 Nov 2022 16:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668012306; bh=s+wAfKA13O4jAHqnut4ePgTM90gidKgKQSE2wr/vBpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oJx3RhbOjPJQVyd3cywVU5KFETRV6aggB1Z81xcgwFeSEV1lxwcNVq6CcUm0Im5N+ WFJ9nRS5DL5Z4rlSw2B2knI5zj367IDIGFLtV9pumYqfs4eefqlnsOdnYZ33xC75OG lfpiDdUQ4ET5BON53QX+Siw+WVpE4BWu4wxcc/n3PWbhufzwDFTqwv4cx6F1mvRpJG g1QS7vt+nbzenotFRewJ/fQq27XZMe6CoAp6vlxm1mdEgT6zde8RofM+V+d5Opbr4M nofPBaSELrMhqcThtwPb9A/KWB6NXpnR8CZ6waMDuoFxyx+SpXBXnkTXv2lQt1au1W NvtHv2EviQ0mw== From: fdmanana@kernel.org To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, Filipe Manana Subject: [PATCH v2 2/3] btrfs/053: fix test failure when running with btrfs-progs v6.0+ Date: Wed, 9 Nov 2022 16:44:57 +0000 Message-Id: <793a063833727ea80a1d0c6f13f531cff9581a1a.1668011940.git.fdmanana@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Filipe Manana In btrfs-progs v6.0 the --leafsize (-l) command line option was removed from mkfs.btrfs, so btrfs/053 can fail with v6.0+ in case the scratch device does not have a btrfs filesystem created before running the test, in which case mounting the scratch device fails. The change was introduced by the following btrfs-progs commit: f7a768d62498 ("btrfs-progs: mkfs: remove support for option --leafsize") Change the test to use --nodesize (-n) instead, since it exists in both old and new btrfs-progs versions. Also redirect mkfs output to the test's log file and fail explicitly if mkfs failed. Signed-off-by: Filipe Manana Reviewed-by: Zorro Lang Reviewed-by: Qu Wenruo --- tests/btrfs/053 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/btrfs/053 b/tests/btrfs/053 index fbd2e7d9..67239f10 100755 --- a/tests/btrfs/053 +++ b/tests/btrfs/053 @@ -44,7 +44,7 @@ send_files_dir=$TEST_DIR/btrfs-test-$seq rm -fr $send_files_dir mkdir $send_files_dir -_scratch_mkfs "-l $leaf_size" >/dev/null 2>&1 +_scratch_mkfs "--nodesize $leaf_size" >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount echo "hello world" > $SCRATCH_MNT/foobar @@ -72,7 +72,7 @@ _run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 -f $send_files_dir/2.snap \ _scratch_unmount _check_scratch_fs -_scratch_mkfs "-l $leaf_size" >/dev/null 2>&1 +_scratch_mkfs "--nodesize $leaf_size" >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount _run_btrfs_util_prog receive -f $send_files_dir/1.snap $SCRATCH_MNT From patchwork Wed Nov 9 16:44:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 13037733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47442C433FE for ; Wed, 9 Nov 2022 16:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230220AbiKIQpP (ORCPT ); Wed, 9 Nov 2022 11:45:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbiKIQpO (ORCPT ); Wed, 9 Nov 2022 11:45:14 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10EC02252B; Wed, 9 Nov 2022 08:45:10 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 4680DCE1FEA; Wed, 9 Nov 2022 16:45:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CD3AC433C1; Wed, 9 Nov 2022 16:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668012307; bh=j1Aieg493NQTqXY3czipEQEPMuHZTJs8oAvLJMoCCmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YUZGFldR7KY1RuaX4oMDyVKCbpdNshSZRmLHHAnCsnlIfQIxC9cFc6FdbGo8rimLR 3XIfCVSVQBRpKdzif/JerQ5uR1HWj5SZGnOOQEeMGN0mq3oCflxJH+NgnT1mOWmzql 2kSCsxYnRIgqPSQ74Fg/OzMDf6+H83ltWGXjeZOqlDqVUlgJ5SY8t0xCs/pgTNSV1G Ztdkn1Ty1H+4ECZ8uZ/rkWryIvIGbqb8tCuH/7liuW44nCwsQaSNNkiCWJZPPKm03d JxUnTi0NNLIKe3Uy2EkDvzdt6hWztR1VIbmj3kJ8/s7lFjGbfDcTYgbUDB6Tq/NSVu N/jSBTc/xCWbg== From: fdmanana@kernel.org To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, Filipe Manana Subject: [PATCH v2 3/3] btrfs: fix failure of tests that use defrag on btrfs-progs v6.0+ Date: Wed, 9 Nov 2022 16:44:58 +0000 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Filipe Manana Starting with btrfs-progs v6.0, the defrag command now prints to stdout the full path of the files it processes. This makes test cases btrfs/021 and btrfs/256 fail because they don't expect any output from the defrag command. The change happened with the following commit in btrfs-progs: dd724f21803d ("btrfs-progs: add logic to handle LOG_DEFAULT messages") So update the tests to ignore the stdout of the defrag command. Signed-off-by: Filipe Manana Reviewed-by: Qu Wenruo --- tests/btrfs/021 | 4 +++- tests/btrfs/256 | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/btrfs/021 b/tests/btrfs/021 index 5943da2f..1b55834a 100755 --- a/tests/btrfs/021 +++ b/tests/btrfs/021 @@ -22,8 +22,10 @@ run_test() sleep 0.5 + # In new versions of btrfs-progs (6.0+), the defrag command outputs to + # stdout the path of the files it operates on. So ignore that. find $SCRATCH_MNT -type f -print0 | xargs -0 \ - $BTRFS_UTIL_PROG filesystem defrag -f + $BTRFS_UTIL_PROG filesystem defrag -f > /dev/null sync wait diff --git a/tests/btrfs/256 b/tests/btrfs/256 index 1360c2c2..acbbc6fa 100755 --- a/tests/btrfs/256 +++ b/tests/btrfs/256 @@ -50,7 +50,9 @@ $FSSUM_PROG -A -f -w "$checksums_file" "$SCRATCH_MNT" # Now defrag each file. for sz in ${file_sizes[@]}; do echo "Defragging file with $sz bytes..." >> $seqres.full - $BTRFS_UTIL_PROG filesystem defragment "$SCRATCH_MNT/f_$sz" + # In new versions of btrfs-progs (6.0+), the defrag command outputs to + # stdout the path of the files it operates on. So ignore that. + $BTRFS_UTIL_PROG filesystem defragment "$SCRATCH_MNT/f_$sz" > /dev/null done # Verify the checksums after the defrag operations.