From patchwork Tue Mar 2 23:22:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12112397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8661CC43381 for ; Wed, 3 Mar 2021 00:12:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DB8064FDF for ; Wed, 3 Mar 2021 00:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235070AbhCCADC (ORCPT ); Tue, 2 Mar 2021 19:03:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:38530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2361109AbhCBXXU (ORCPT ); Tue, 2 Mar 2021 18:23:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0616E64F34; Tue, 2 Mar 2021 23:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614727360; bh=WYpnpXEdkxLChyk2Ffg5+vuAPJHiTNT5oscrzIXJVzM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=EVb8oPSo7FnRDZwc2zlljYFtNOLgopwKXIY+yLYg/a53jvdzt/pZxex7V0mpWsEps +MlAgXBJ5MU5j83PitzQ06WdjWEcx6A9u/DlihlZoWcaLStHbMWp9Y1ORkxSt7pIfu d6b1Vr+Tu+ejyoGQ3oMjMcuEwX5wJfjETsYpAHvgmKUSIIAMeMyUFRE7/IjyxyHvpI K7rpL6bVJoGv8yIcy7eFWS2v2d+OpyhrcH/f98SzLQbrs2y9T/H59Dlk8FvTBmuN72 ZjhFVbLai0XLwLoxtkKAuOx1IzoF2yumd2NgGP1HRrTKb8YIbYocNuLoSUHBmK7obL i7Qr0Wzw5Btzg== Subject: [PATCH 1/4] generic/623: don't fail on core dumps From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 02 Mar 2021 15:22:39 -0800 Message-ID: <161472735969.3478298.17752955323122832118.stgit@magnolia> In-Reply-To: <161472735404.3478298.8179031068431918520.stgit@magnolia> References: <161472735404.3478298.8179031068431918520.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong This test is designed to fail an mmap write and see what happens. Typically this is a segmentation fault. If the user's computer is configured to capture core dumps, this will cause the test to fail, even though we got the reaction we wanted. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig --- tests/generic/623 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/generic/623 b/tests/generic/623 index 7be38955..04411405 100755 --- a/tests/generic/623 +++ b/tests/generic/623 @@ -37,6 +37,7 @@ _scratch_mount # status on the page. file=$SCRATCH_MNT/file $XFS_IO_PROG -fc "pwrite 0 4k" -c fsync $file | _filter_xfs_io +ulimit -c 0 $XFS_IO_PROG -x -c "mmap 0 4k" -c "mwrite 0 4k" -c shutdown -c fsync \ -c "mwrite 0 4k" $file | _filter_xfs_io From patchwork Tue Mar 2 23:22:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12112401 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DB45C28E80 for ; Wed, 3 Mar 2021 00:12:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54F3064F16 for ; Wed, 3 Mar 2021 00:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235274AbhCCAD0 (ORCPT ); Tue, 2 Mar 2021 19:03:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:38566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2361110AbhCBXX0 (ORCPT ); Tue, 2 Mar 2021 18:23:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 90CDB64F39; Tue, 2 Mar 2021 23:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614727365; bh=2oyFzPf7zo59T6UmCeDEbgc4XUptJkxuMlmAGUT1Vow=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=WVSimCf0ZriWxsnfww0hdphD94mgkJPmqAzRKe75xKQBz+idQArhZ3Ul7LstTyzMa BedsTZmh84tgE9LQRfvM2j+0Wvc7d6RjxuT183MzE1uEMro7NhTwW/T9dUJjVE8xEi e/ZfbzCRfnuNtu1UuErP9/9DuCUjf3jEJE7I449Ox4fCIH/OgkL1a4vnVibBwAsUdr 7vl6RSUcrljJYwtou5hyyngrKFUM+K+csNmLB7klb2gXlzQaj+jFZhnLWOU/MsvZMO yj/u+dfVcO4SalEe2bve+ucbcKhGbQHS9tGA1Z8AIMn5DqvHJEvf1W+VWquayJ4SLR awXRMLKjGRPGA== Subject: [PATCH 2/4] xfs/271: fix test failure on non-reflink filesystems From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 02 Mar 2021 15:22:45 -0800 Message-ID: <161472736521.3478298.1405183245326186350.stgit@magnolia> In-Reply-To: <161472735404.3478298.8179031068431918520.stgit@magnolia> References: <161472735404.3478298.8179031068431918520.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong This test creates an empty filesystem with rmap btrees enabled, and then checks that GETFSMAP corresponds (roughly) with what we expect mkfs to have written to the filesystem. Unfortunately, the test's calculation for the number of "per-AG metadata" extents is not quite correct. For a filesystem with a refcount btree, the rmapbt and agfl blocks will be reported separately, but for non-reflink filesystems, GETFSMAP merges the records. Since this test counts the number of records, fix the calculation. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig --- tests/xfs/271 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/xfs/271 b/tests/xfs/271 index 48a3eb8f..35c23b84 100755 --- a/tests/xfs/271 +++ b/tests/xfs/271 @@ -38,6 +38,16 @@ _scratch_mount agcount=$(_xfs_mount_agcount $SCRATCH_MNT) +# mkfs lays out btree root blocks in the order bnobt, cntbt, inobt, finobt, +# rmapbt, refcountbt, and then allocates AGFL blocks. Since GETFSMAP has the +# same owner (per-AG metadata) for rmap btree blocks and blocks on the AGFL and +# the reverse mapping index merges records, the number of per-AG extents +# reported will vary depending on whether the refcount btree is enabled. +$XFS_INFO_PROG $SCRATCH_MNT | grep -q reflink=1 +has_reflink=$(( 1 - $? )) +perag_metadata_exts=2 +test $has_reflink -gt 0 && perag_metadata_exts=$((perag_metadata_exts + 1)) + echo "Get fsmap" | tee -a $seqres.full $XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT > $TEST_DIR/fsmap cat $TEST_DIR/fsmap >> $seqres.full @@ -48,7 +58,7 @@ _within_tolerance "AG header count" $(wc -l < $TEST_DIR/testout) $agcount 0 -v echo "Check freesp/rmap btrees" | tee -a $seqres.full grep 'per-AG metadata[[:space:]]*[0-9]*[[:space:]]*([0-9]*\.\.' $TEST_DIR/fsmap | tee -a $seqres.full > $TEST_DIR/testout -_within_tolerance "freesp extent count" $(wc -l < $TEST_DIR/testout) $((agcount * 3)) 0 999999 -v +_within_tolerance "freesp extent count" $(wc -l < $TEST_DIR/testout) $((agcount * perag_metadata_exts)) 0 999999 -v echo "Check inode btrees" | tee -a $seqres.full grep 'inode btree[[:space:]]*[0-9]*[[:space:]]*([0-9]*\.\.' $TEST_DIR/fsmap | tee -a $seqres.full > $TEST_DIR/testout From patchwork Tue Mar 2 23:22:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12112399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D39DC41620 for ; Wed, 3 Mar 2021 00:12:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F4A064FC8 for ; Wed, 3 Mar 2021 00:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235117AbhCCADo (ORCPT ); Tue, 2 Mar 2021 19:03:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:38614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2361111AbhCBXXb (ORCPT ); Tue, 2 Mar 2021 18:23:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1167A64F3B; Tue, 2 Mar 2021 23:22:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614727371; bh=+5fbK8L4V4hl8wvHYx0hPrG7RpEAU7/C0udYIcd6tDc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=NEHk1gaO5o8ncOl3hG/59z3RaS9DyWHQbQS8pUbq4PTlSK5ZCxbI6UnNA23l3XIDY DBoInsp2AR9Kc5He0alB5bwBcavpKOwoSS5Cku5q1YKZlbgotUbS9Ilszpb/EH0oDy aU0/WrP/RhCowKClHkPTEWZh+m6vcVg2QF8UmvTrVhPVgj5iBLSnePPdxoLgHrbDZY yQNbaUw1DvV5QXgz2TVdpNiCSc2tz+2D4yxVnuuYJUVgrqrKQB2HmxUwrmO+0K09eu eYVx/1wClN6jj6MujI1Ycy+VXi9a8ass/704t2rC5GM2jEUBSX6rb0ggE4s+gsHB1h HzQr9j0tug+3g== Subject: [PATCH 3/4] common/rc: fix detection of device-mapper/persistent memory incompatibility From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 02 Mar 2021 15:22:50 -0800 Message-ID: <161472737079.3478298.2584850499235911991.stgit@magnolia> In-Reply-To: <161472735404.3478298.8179031068431918520.stgit@magnolia> References: <161472735404.3478298.8179031068431918520.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong In commit fc7b3903, we tried to make _require_dm_target smart enough to _notrun tests that require a device mapper target that isn't compatible with "DAX". However, as of this writing, the incompatibility stems from device mapper's unwillingness to switch access modes when running atop DAX (persistent memory) devices, and has nothing to do with the filesystem mount options. Since filesystems supporting DAX don't universally require "dax" in the mount options to enable that functionality, switch the test to query sysfs to see if the scratch device supports DAX. Fixes: fc7b3903 ("dax/dm: disable testing on devices that don't support dax") Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Christoph Hellwig --- common/rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 7254130f..10e5f40b 100644 --- a/common/rc +++ b/common/rc @@ -1889,7 +1889,8 @@ _require_dm_target() _require_sane_bdev_flush $SCRATCH_DEV _require_command "$DMSETUP_PROG" dmsetup - _normalize_mount_options | egrep -q "dax(=always| |$)" + _normalize_mount_options | egrep -q "dax(=always| |$)" || \ + test -e "/sys/block/$(_short_dev $SCRATCH_DEV)/dax" if [ $? -eq 0 ]; then case $target in stripe|linear|log-writes) From patchwork Tue Mar 2 23:22:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12112403 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 522B7C28D17 for ; Wed, 3 Mar 2021 00:12:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07ABF64FC7 for ; Wed, 3 Mar 2021 00:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235233AbhCCAEg (ORCPT ); Tue, 2 Mar 2021 19:04:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:38650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2361112AbhCBXXh (ORCPT ); Tue, 2 Mar 2021 18:23:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 895B264F3C; Tue, 2 Mar 2021 23:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614727376; bh=697Nb2di+BUNIoecDPwRGI5l1BRr1zPGoqYUfZiiDag=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=rz1rISzIZI9+2jEpsw2jt7jJPbMHtOJSeuXONj6chUHAZnGed09ps+bSMjQ6l4raf S/MnOES1JOUEOc4mhKJA8vIIWPUYkBYiVreBTNdnoTsJCgKnzHjRRT6Z4OThXaUWPc g7wdGGW08g2xKGFpGwQMotYhS4CsYJxQagOgDIZX/AqCze3FKT3ywehjzz6BGvbWvh eFaSjZO04Ne+pIRuCP8VszFZKECMThMmKTh3Tc6FtIkNxEaow47/TKbiy4XMAv4qCv +HIkQD7vIZK2mkJcmlUuIUIsjTonkGYCSsI45piCbKbDXDMV6MBqNX5gk7XDmd2STB Ou5TeBWufV6bA== Subject: [PATCH 4/4] generic/60[78]: ensure the initial DAX file flag state before test From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 02 Mar 2021 15:22:56 -0800 Message-ID: <161472737624.3478298.18322455058303982173.stgit@magnolia> In-Reply-To: <161472735404.3478298.8179031068431918520.stgit@magnolia> References: <161472735404.3478298.8179031068431918520.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Since this test checks the behaviors of both the in-core S_DAX flag and the ondisk FS_XFLAG_DAX inode flags, it must be careful about the initial state of the filesystem w.r.t. the inode flag. Make sure that the root directory does /not/ have the inode flag set before we begin testing, so that the initial state doesn't throw off inheritance testing. Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R --- tests/generic/607 | 4 ++++ tests/generic/608 | 3 +++ 2 files changed, 7 insertions(+) diff --git a/tests/generic/607 b/tests/generic/607 index dd6dbd65..ba7da11b 100755 --- a/tests/generic/607 +++ b/tests/generic/607 @@ -156,6 +156,10 @@ do_xflag_tests() local option=$1 _scratch_mount "$option" + + # Make sure the root dir doesn't have FS_XFLAG_DAX set before we start. + chattr -x $SCRATCH_MNT &>> $seqres.full + cd $SCRATCH_MNT for i in $(seq 1 5); do diff --git a/tests/generic/608 b/tests/generic/608 index dd89d91c..13a751d7 100755 --- a/tests/generic/608 +++ b/tests/generic/608 @@ -98,6 +98,9 @@ do_tests() _scratch_mount "$mount_option" + # Make sure the root dir doesn't have FS_XFLAG_DAX set before we start. + chattr -x $SCRATCH_MNT &>> $seqres.full + test_drop_caches test_cycle_mount "$cycle_mount_option"