From patchwork Wed Jun 3 14:01:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 11585713 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3D51F913 for ; Wed, 3 Jun 2020 14:07:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24A2A20679 for ; Wed, 3 Jun 2020 14:07:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725981AbgFCOHz (ORCPT ); Wed, 3 Jun 2020 10:07:55 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:19599 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725943AbgFCOHz (ORCPT ); Wed, 3 Jun 2020 10:07:55 -0400 X-IronPort-AV: E=Sophos;i="5.73,467,1583164800"; d="scan'208";a="93765256" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Jun 2020 22:07:43 +0800 Received: from G08CNEXMBPEKD05.g08.fujitsu.local (unknown [10.167.33.204]) by cn.fujitsu.com (Postfix) with ESMTP id 8E1B14BCC8AC; Wed, 3 Jun 2020 22:07:39 +0800 (CST) Received: from G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.200) by G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jun 2020 22:07:39 +0800 Received: from Fedora-30.g08.fujitsu.local (10.167.220.106) by G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 3 Jun 2020 22:07:33 +0800 From: Xiao Yang To: CC: , , Xiao Yang Subject: [PATCH 1/4] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX Date: Wed, 3 Jun 2020 22:01:12 +0800 Message-ID: <20200603140115.30392-1-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-yoursite-MailScanner-ID: 8E1B14BCC8AC.AD335 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org 1) _require_scratch_dax_mountopt() checks both old and new DAX mount option 2) _require_scratch_daX_iflag() checks FS_XFLAG_DAX Signed-off-by: Xiao Yang Reviewed-by: Darrick J. Wong --- common/rc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/common/rc b/common/rc index a6967831..ec7c19e4 100644 --- a/common/rc +++ b/common/rc @@ -3188,6 +3188,41 @@ _require_scratch_dax() _scratch_unmount } +_require_scratch_dax_mountopt() +{ + local mountopt=$1 + local output + + _require_scratch + _scratch_mkfs > /dev/null 2>&1 + _try_scratch_mount -o "$mountopt" || \ + _notrun "mount $SCRATCH_DEV with $mountopt failed" + + output=$(_fs_options $SCRATCH_DEV) + + # For new dax mount option, /proc/mounts shows different outputs if we + # mount with -o dax=inode on ext4 and xfs so skip checking it. + # /proc/mounts shows 'dax=inode' on ext4 but shows nothing on xfs. + if [ "$mountopt" != "dax=inode" ]; then + echo $output | grep -qw "$mountopt" || \ + _notrun "$SCRATCH_DEV $FSTYP does not support -o $mountopt" + fi + + # For new dax mount option, /proc/mounts shows "dax=never" if we + # mount with -o dax on xfs and underlying device doesn't support dax. + if [ "$mountopt" = "dax" ]; then + echo $output | grep -qw "dax=never" && \ + _notrun "$SCRATCH_DEV $FSTYP does not support -o $mountopt" + fi + + _scratch_unmount +} + +_require_scratch_dax_iflag() +{ + _require_xfs_io_command "chattr" "x" +} + # Does norecovery support by this fs? _require_norecovery() { From patchwork Wed Jun 3 14:01:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 11585711 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7802618 for ; Wed, 3 Jun 2020 14:07:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B5B2207D8 for ; Wed, 3 Jun 2020 14:07:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725967AbgFCOHy (ORCPT ); Wed, 3 Jun 2020 10:07:54 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:41828 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725833AbgFCOHy (ORCPT ); Wed, 3 Jun 2020 10:07:54 -0400 X-IronPort-AV: E=Sophos;i="5.73,467,1583164800"; d="scan'208";a="93765254" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Jun 2020 22:07:43 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id 6AEED4BCC8B3; Wed, 3 Jun 2020 22:07:40 +0800 (CST) Received: from G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.200) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jun 2020 22:07:41 +0800 Received: from Fedora-30.g08.fujitsu.local (10.167.220.106) by G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 3 Jun 2020 22:07:40 +0800 From: Xiao Yang To: CC: , , Xiao Yang Subject: [PATCH 2/4] fstests: Use _require_scratch_dax_mountopt() and _require_scratch_daX_iflag() Date: Wed, 3 Jun 2020 22:01:13 +0800 Message-ID: <20200603140115.30392-2-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200603140115.30392-1-yangx.jy@cn.fujitsu.com> References: <20200603140115.30392-1-yangx.jy@cn.fujitsu.com> MIME-Version: 1.0 X-yoursite-MailScanner-ID: 6AEED4BCC8B3.AD17A X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Make related tests use _require_scratch_dax_mountopt() and _require_scratch_daX_iflag() Signed-off-by: Xiao Yang --- tests/ext4/030 | 2 +- tests/ext4/031 | 4 ++-- tests/generic/413 | 2 +- tests/generic/462 | 2 +- tests/xfs/260 | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/ext4/030 b/tests/ext4/030 index 93bbca86..fb5cf451 100755 --- a/tests/ext4/030 +++ b/tests/ext4/030 @@ -33,7 +33,7 @@ rm -f $seqres.full # Modify as appropriate. _supported_os Linux _supported_fs ext4 -_require_scratch_dax +_require_scratch_dax_mountopt "dax" _require_test_program "t_ext4_dax_journal_corruption" _require_command "$CHATTR_PROG" chattr diff --git a/tests/ext4/031 b/tests/ext4/031 index dc58214e..20e2fab7 100755 --- a/tests/ext4/031 +++ b/tests/ext4/031 @@ -37,7 +37,7 @@ MOUNT_OPTIONS="" # Modify as appropriate. _supported_os Linux _supported_fs ext4 -_require_scratch_dax +_require_scratch_dax_mountopt "dax" _require_test_program "t_ext4_dax_inline_corruption" _require_scratch_ext4_feature "inline_data" @@ -56,7 +56,7 @@ _scratch_unmount >> $seqres.full 2>&1 _try_scratch_mount "-o dax" >> $seqres.full 2>&1 if [[ $? != 0 ]]; then - # _require_scratch_dax already verified that we could mount with DAX. + # _require_scratch_dax_mountopt already verified that we could mount with DAX. # Failure here is expected because we have inline data. echo "Silence is golden" status=0 diff --git a/tests/generic/413 b/tests/generic/413 index 1ce89aff..19e1b926 100755 --- a/tests/generic/413 +++ b/tests/generic/413 @@ -31,7 +31,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_test -_require_scratch_dax +_require_scratch_dax_mountopt "dax" _require_test_program "feature" _require_test_program "t_mmap_dio" _require_xfs_io_command "falloc" diff --git a/tests/generic/462 b/tests/generic/462 index 1ab6cadc..4a940239 100755 --- a/tests/generic/462 +++ b/tests/generic/462 @@ -37,7 +37,7 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_test -_require_scratch_dax +_require_scratch_dax_mountopt "dax" _require_test_program "t_mmap_write_ro" # running by unpriviliged user is not necessary to reproduce # this bug, just trying to test more. diff --git a/tests/xfs/260 b/tests/xfs/260 index 3464ffef..fbdc4cd8 100755 --- a/tests/xfs/260 +++ b/tests/xfs/260 @@ -30,10 +30,10 @@ rm -f $seqres.full _supported_fs xfs _supported_os Linux -_require_scratch_dax +_require_scratch_dax_mountopt "dax" _require_test_program "feature" _require_test_program "t_mmap_dio" -_require_xfs_io_command "chattr" "x" +_require_scratch_dax_iflag _require_xfs_io_command "falloc" prep_files() From patchwork Wed Jun 3 14:01:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 11585715 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2937C913 for ; Wed, 3 Jun 2020 14:07:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1178C20679 for ; Wed, 3 Jun 2020 14:07:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725943AbgFCOH4 (ORCPT ); Wed, 3 Jun 2020 10:07:56 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:41828 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725833AbgFCOH4 (ORCPT ); Wed, 3 Jun 2020 10:07:56 -0400 X-IronPort-AV: E=Sophos;i="5.73,467,1583164800"; d="scan'208";a="93765255" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Jun 2020 22:07:43 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id 411194BCC8BB; Wed, 3 Jun 2020 22:07:41 +0800 (CST) Received: from G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.200) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jun 2020 22:07:41 +0800 Received: from Fedora-30.g08.fujitsu.local (10.167.220.106) by G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 3 Jun 2020 22:07:41 +0800 From: Xiao Yang To: CC: , , Xiao Yang Subject: [PATCH 3/4] common/rc: Remove unused _require_scratch_dax() Date: Wed, 3 Jun 2020 22:01:14 +0800 Message-ID: <20200603140115.30392-3-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200603140115.30392-1-yangx.jy@cn.fujitsu.com> References: <20200603140115.30392-1-yangx.jy@cn.fujitsu.com> MIME-Version: 1.0 X-yoursite-MailScanner-ID: 411194BCC8BB.AA89A X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Signed-off-by: Xiao Yang --- common/rc | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/common/rc b/common/rc index ec7c19e4..dba52002 100644 --- a/common/rc +++ b/common/rc @@ -3175,19 +3175,6 @@ _require_scratch_shutdown() } # Does dax mount option work on this dev/fs? -_require_scratch_dax() -{ - _require_scratch - _scratch_mkfs > /dev/null 2>&1 - _try_scratch_mount -o dax || \ - _notrun "mount $SCRATCH_DEV with dax failed" - # Check options to be sure. XFS ignores dax option - # and goes on if dev underneath does not support dax. - _fs_options $SCRATCH_DEV | grep -qw "dax" || \ - _notrun "$SCRATCH_DEV $FSTYP does not support -o dax" - _scratch_unmount -} - _require_scratch_dax_mountopt() { local mountopt=$1 From patchwork Wed Jun 3 14:01:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 11585709 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2B5F618 for ; Wed, 3 Jun 2020 14:07:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4D3820738 for ; Wed, 3 Jun 2020 14:07:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725920AbgFCOHt (ORCPT ); Wed, 3 Jun 2020 10:07:49 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:41828 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725833AbgFCOHt (ORCPT ); Wed, 3 Jun 2020 10:07:49 -0400 X-IronPort-AV: E=Sophos;i="5.73,467,1583164800"; d="scan'208";a="93765252" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Jun 2020 22:07:43 +0800 Received: from G08CNEXMBPEKD05.g08.fujitsu.local (unknown [10.167.33.204]) by cn.fujitsu.com (Postfix) with ESMTP id 31A0A50A999D; Wed, 3 Jun 2020 22:07:42 +0800 (CST) Received: from G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.200) by G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jun 2020 22:07:42 +0800 Received: from Fedora-30.g08.fujitsu.local (10.167.220.106) by G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 3 Jun 2020 22:07:42 +0800 From: Xiao Yang To: CC: , , Xiao Yang Subject: [PATCH 4/4] xfs/260: Move xfs/260 to generic Date: Wed, 3 Jun 2020 22:01:15 +0800 Message-ID: <20200603140115.30392-4-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200603140115.30392-1-yangx.jy@cn.fujitsu.com> References: <20200603140115.30392-1-yangx.jy@cn.fujitsu.com> MIME-Version: 1.0 X-yoursite-MailScanner-ID: 31A0A50A999D.A9B27 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Both ext4 and xfs support per-inode DAX flag now so move it to generic. Signed-off-by: Xiao Yang --- tests/{xfs/260 => generic/602} | 12 ++++++++---- tests/generic/602.out | 2 ++ tests/generic/group | 1 + tests/xfs/260.out | 2 -- tests/xfs/group | 1 - 5 files changed, 11 insertions(+), 7 deletions(-) rename tests/{xfs/260 => generic/602} (91%) create mode 100644 tests/generic/602.out delete mode 100644 tests/xfs/260.out diff --git a/tests/xfs/260 b/tests/generic/602 similarity index 91% rename from tests/xfs/260 rename to tests/generic/602 index fbdc4cd8..0cd20f31 100755 --- a/tests/xfs/260 +++ b/tests/generic/602 @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2017 Red Hat Inc. All Rights Reserved. # -# FS QA Test 260 +# FS QA Test 602 # # Test per-inode DAX flag by mmap direct/buffered IO. # @@ -28,7 +28,7 @@ _cleanup() # remove previous $seqres.full before test rm -f $seqres.full -_supported_fs xfs +_supported_fs generic _supported_os Linux _require_scratch_dax_mountopt "dax" _require_test_program "feature" @@ -121,8 +121,12 @@ do_tests() t_dax_flag_mmap_dio $((64 * 1024 * 1024)) } -# make xfs 2Mb aligned for PMD fault testing -_scratch_mkfs "-d su=2m,sw=1" > /dev/null 2>&1 +# make 2Mb aligned for PMD fault testing +mkfs_opts="" +[ "$FSTYP" = "ext4" ] && mkfs_opts="-E stride=512,stripe_width=1" +[ "$FSTYP" = "xfs" ] && mkfs_opts="-d su=2m,sw=1" + +_scratch_mkfs "$mkfs_opts" > /dev/null 2>&1 # mount with dax option _scratch_mount "-o dax" diff --git a/tests/generic/602.out b/tests/generic/602.out new file mode 100644 index 00000000..61976e5e --- /dev/null +++ b/tests/generic/602.out @@ -0,0 +1,2 @@ +QA output created by 602 +Silence is golden diff --git a/tests/generic/group b/tests/generic/group index c6ce029c..4bda3772 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -604,3 +604,4 @@ 599 auto quick remount shutdown 600 auto quick quota 601 auto quick quota +602 auto attr quick dax diff --git a/tests/xfs/260.out b/tests/xfs/260.out deleted file mode 100644 index 18ca517c..00000000 --- a/tests/xfs/260.out +++ /dev/null @@ -1,2 +0,0 @@ -QA output created by 260 -Silence is golden diff --git a/tests/xfs/group b/tests/xfs/group index daf54add..71c30898 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -257,7 +257,6 @@ 257 auto quick clone 258 auto quick clone 259 auto quick -260 auto attr quick dax 261 auto quick quota 262 dangerous_fuzzers dangerous_scrub dangerous_online_repair 263 auto quick quota