From patchwork Tue Jun 28 18:25:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 12898707 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 EDBBECCA479 for ; Tue, 28 Jun 2022 18:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231223AbiF1SZ7 (ORCPT ); Tue, 28 Jun 2022 14:25:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234790AbiF1SZ4 (ORCPT ); Tue, 28 Jun 2022 14:25:56 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 326C221804 for ; Tue, 28 Jun 2022 11:25:55 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-118-63.bstnma.fios.verizon.net [173.48.118.63]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 25SIPn7o025902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 14:25:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656440750; bh=Uco/WluYMNn3eCmZiQEHi6LM0F4ScJpfvUiF1cap0Uw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=F9HVhBu1SxTg+fXBvNFETsY3fS272CNjcumdNzFCyfU3FV/Cb65Bfo5nPVEJ8+xQo wz3JzsgLPGo3Xljdw438qP7OuIoLPmLmzIhKPqslKg46+eIY+wWm/sBg0qap0LTEwb uZl5cOIPeNR28PeOH/ah44JcJD86fgOs/Mt5NhH8we6BztT4t6IXOG4Ih5XcF8tZWI e2yTOEYq7485JFbcL8QSULJ9gYL6j3yYK2j6aEwM7HkaWIZ3Zp//LYPjyRvUj3US84 ojSswPHeBSIej60fQLIJa84WNESPzuUnsLEIVcmwlD/220MJ6yK1pgCpUjFevHK9lm N5sa4gnQjUn9w== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 7C9B915C4312; Tue, 28 Jun 2022 14:25:49 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH 1/6] ext4/050: support indirect as well as extent mapped journals Date: Tue, 28 Jun 2022 14:25:40 -0400 Message-Id: <20220628182545.1834145-2-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220628182545.1834145-1-tytso@mit.edu> References: <20220628182545.1834145-1-tytso@mit.edu> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Simplify the test and fix ext4/050 failures when running ext4 without extents enabled (e.g., in ext3 emulation mode). Instead of relying on parsing debugfs output's (which varies depending on whether the journal inode is extent mapped or indirect block mapped), use debugfs's "cat" command to get the contents of the journal. Signed-off-by: Theodore Ts'o Reviewed-by: Zorro Lang --- tests/ext4/050 | 58 +++++--------------------------------------------- 1 file changed, 5 insertions(+), 53 deletions(-) diff --git a/tests/ext4/050 b/tests/ext4/050 index 79961957..6f93b86d 100755 --- a/tests/ext4/050 +++ b/tests/ext4/050 @@ -22,55 +22,6 @@ _require_command "$DEBUGFS_PROG" debugfs checkpoint_journal=$here/src/checkpoint_journal _require_test_program "checkpoint_journal" -# convert output from stat to list of block numbers -get_journal_extents() { - inode_info=$($DEBUGFS_PROG $SCRATCH_DEV -R "stat <8>" 2>> $seqres.full) - echo -e "\nJournal info:" >> $seqres.full - echo "$inode_info" >> $seqres.full - - extents_line=$(echo "$inode_info" | awk '/EXTENTS:/{ print NR; exit }') - get_extents=$(echo "$inode_info" | sed -n "$(($extents_line + 1))"p) - - # get just the physical block numbers - get_extents=$(echo "$get_extents" | perl -pe 's|\(.*?\):||g' | sed -e 's/, /\n/g' | perl -pe 's|(\d+)-(\d+)|\1 \2|g') - - echo "$get_extents" -} - -# checks all extents are zero'd out except for the superblock -# arg 1: extents (output of get_journal_extents()) -check_extents() { - echo -e "\nChecking extents:" >> $seqres.full - echo "$1" >> $seqres.full - - super_block="true" - echo "$1" | while IFS= read line; do - start_block=$(echo $line | cut -f1 -d' ') - end_block=$(echo $line | cut -f2 -d' ' -s) - - # if first block of journal, shouldn't be wiped - if [ "$super_block" == "true" ]; then - super_block="false" - - #if super block only block in this extent, skip extent - if [ -z "$end_block" ]; then - continue; - fi - start_block=$(($start_block + 1)) - fi - - if [ ! -z "$end_block" ]; then - blocks=$(($end_block - $start_block + 1)) - else - blocks=1 - fi - - check=$(od $SCRATCH_DEV --skip-bytes=$(($start_block * $blocksize)) --read-bytes=$(($blocks * $blocksize)) -An -v | sed -e 's/[0 \t\n\r]//g') - - [ ! -z "$check" ] && echo "error" && break - done -} - testdir="${SCRATCH_MNT}/testdir" _scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 @@ -93,11 +44,12 @@ sync --file-system $testdir/1 # call ioctl to checkpoint and zero-fill journal blocks $checkpoint_journal $SCRATCH_MNT --erase=zeroout || _fail "ioctl returned error" -extents=$(get_journal_extents) - # check journal blocks zeroed out -ret=$(check_extents "$extents") -[ "$ret" = "error" ] && _fail "Journal was not zero-filled" +$DEBUGFS_PROG $SCRATCH_DEV -R "cat <8>" 2> /dev/null | od >> $seqres.full +check=$($DEBUGFS_PROG $SCRATCH_DEV -R "cat <8>" 2> /dev/null | \ + od --skip-bytes="$blocksize" -An -v | sed -e '/^[0 \t]*$/d') + +[ ! -z "$check" ] && _fail "Journal was not zeroed" _scratch_unmount >> $seqres.full 2>&1 From patchwork Tue Jun 28 18:25:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 12898702 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 BC340C43334 for ; Tue, 28 Jun 2022 18:25:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbiF1SZy (ORCPT ); Tue, 28 Jun 2022 14:25:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231223AbiF1SZy (ORCPT ); Tue, 28 Jun 2022 14:25:54 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 651C52125C for ; Tue, 28 Jun 2022 11:25:53 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-118-63.bstnma.fios.verizon.net [173.48.118.63]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 25SIPnHt025888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 14:25:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656440750; bh=8xanglkN43VBugMwl8Hkn6Aw6FFf9nySfPvIfCCfQOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cMdDV62kcQ+0Kel6LnPVGVwQSgYSMhBLGyj1T1uw28/0lL6IQ/E0OPQgq4u+NHYT8 szxDEBMK2Z3TS+4CptQOka5eQn8s9UiamobzrjZijGralqqbagr9srX/Yx3em2wAM1 0Xbqo+I1tl5Kj7syDvGYQxdUo+bfdcqlP+/2pnFjK6BLOTtzBYzv2OjAqvPG0ISMZD CIATxspv9ZYVtbXwiv2bAnbAxU7cX3ldK3NSlr0riEcAcTKn6vr+vfeCyZxTdv/uiF AAk7je0cUthBYIr1FmRDNhjiv1GnDygCe+OAZHW49F2eI6BhUx9TECeLfPSY0kZOpR VNMKcjIExh3mw== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 7E39D15C4314; Tue, 28 Jun 2022 14:25:49 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" Subject: [PATCH 2/6] ext4/044: skip test if the file system does not have a journal Date: Tue, 28 Jun 2022 14:25:41 -0400 Message-Id: <20220628182545.1834145-3-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220628182545.1834145-1-tytso@mit.edu> References: <20220628182545.1834145-1-tytso@mit.edu> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This test mounts the file system using "mount -t ext3"; if the file system config creates the file system without the jbd2 journal, the "mount -t ext3" will fail. So skip this test in that case. Signed-off-by: Theodore Ts'o --- tests/ext4/044 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ext4/044 b/tests/ext4/044 index 46e44053..158e2ac5 100755 --- a/tests/ext4/044 +++ b/tests/ext4/044 @@ -16,6 +16,7 @@ _begin_fstest auto quick _supported_fs ext4 _require_scratch _require_test_program "t_get_file_time" +_require_metadata_journaling echo "Silence is golden" From patchwork Tue Jun 28 18:25:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 12898703 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 0CD8ECCA479 for ; Tue, 28 Jun 2022 18:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234804AbiF1SZ5 (ORCPT ); Tue, 28 Jun 2022 14:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233384AbiF1SZz (ORCPT ); Tue, 28 Jun 2022 14:25:55 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7AD721267 for ; Tue, 28 Jun 2022 11:25:53 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-118-63.bstnma.fios.verizon.net [173.48.118.63]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 25SIPn6N025897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 14:25:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656440750; bh=40xglbfH65cVdYg2Tzb+ttMm2oeA1aBJ3SR9rqRk4tQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oK0sSL2vXpmYUO7zkDkUhVYemczTcfAUCzkiQ3alat+mB1Kgga+w6hAt0ovCikLIK H1ebSw09xAPQ78Of+onoTiVXmmY5IoBveRknq9OoHpHpktvMP3kXA97oqjz0tmI4sE iJO1AiCsGJjTTBOzmCW92GF1+uk/bHpXsQdH8ym7hULYB1FaArmxtEzwQN9ernkJXf ah5dihHoCFgv7V38O12uIh4MCME8UeH6gGxiKL2QiBoEgg9/2GK2a5M/D8DyA8G9Sk 1NNLx+5nlNC6FAiEAYn+7W/O359mpd4qIlIY7CYNoi9oxrQGuaEYoWdQ7mpde32trR gwgJprVt6cvmQ== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 7FE9D15C4316; Tue, 28 Jun 2022 14:25:49 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" Subject: [PATCH 3/6] ext4/045: _require_dumpe2fs doesn't take any arguments so remove them Date: Tue, 28 Jun 2022 14:25:42 -0400 Message-Id: <20220628182545.1834145-4-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220628182545.1834145-1-tytso@mit.edu> References: <20220628182545.1834145-1-tytso@mit.edu> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Signed-off-by: Theodore Ts'o --- tests/ext4/045 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ext4/045 b/tests/ext4/045 index ee7c0de3..4f0ad4aa 100755 --- a/tests/ext4/045 +++ b/tests/ext4/045 @@ -22,7 +22,7 @@ _supported_fs ext4 _require_scratch _require_test_program "t_create_short_dirs" _require_test_program "t_create_long_dirs" -_require_dumpe2fs "$DUMPE2FS_PROG" dumpe2fs +_require_dumpe2fs echo "Silence is golden" From patchwork Tue Jun 28 18:25:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 12898704 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 C4A43C433EF for ; Tue, 28 Jun 2022 18:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233384AbiF1SZ5 (ORCPT ); Tue, 28 Jun 2022 14:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232422AbiF1SZz (ORCPT ); Tue, 28 Jun 2022 14:25:55 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CB862126D for ; Tue, 28 Jun 2022 11:25:54 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-118-63.bstnma.fios.verizon.net [173.48.118.63]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 25SIPneH025907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 14:25:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656440750; bh=pOckgTVCuMooqwl2VCGxJiy8hryQhb6ybvoL/Ts85ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bnS0jQ4RzoRD38XKfppq6qddqig6t59q7CjdlXGiqPQQ1Emr0kFRZOcBx58gmk1X7 5n7/CNhS4vAk9tM2XkP1R9pF1ZKKWhKqrQUp57QUDqaaO6TIqkSh/6qvMJMNm6EyKP M0Do/1qsP/LDY/9pWDcIMrH28ADiv2dpmB0YNlnJHHzZiPHwS1+rqbi1s6jg4wolgs 9NxggxBeklzPGmcapXm/BT6q49WtjNEEYvj57OrQcB0GddM2LtOCZ/4L0+Wbicj/js zhriXbd6kxGF35V7Iakm6DK3FYeT4UzmnUitZLHW8KNuIfFfth1wuJyfW/MuCLnXk3 rFnBFylAJpCEw== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 81DEE15C4317; Tue, 28 Jun 2022 14:25:49 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH 4/6] ext4/054: skip test if the dax mount option is enabled Date: Tue, 28 Jun 2022 14:25:43 -0400 Message-Id: <20220628182545.1834145-5-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220628182545.1834145-1-tytso@mit.edu> References: <20220628182545.1834145-1-tytso@mit.edu> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org The ext4/054 test explicitly creates a file system with a 1k blocksize. This can't possibly work on if the dax mount option is enabled, so change ext4/054 to use _scratch_mkfs_blocksized, and and a check to _scratch_mkfs_blocksized to _notrun the test if the block size is less than the page size. Also remove an unnecessary _require_test declaration since this test does not use the test device. Signed-off-by: Theodore Ts'o Reviewed-by: Zorro Lang --- common/rc | 3 +++ tests/ext4/054 | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/rc b/common/rc index 9378ff26..3014f5fc 100644 --- a/common/rc +++ b/common/rc @@ -1220,6 +1220,9 @@ _scratch_mkfs_blocksized() if ! [[ $blocksize =~ $re ]] ; then _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer." fi + if [ $blocksize -lt $(get_page_size) ]; then + _exclude_scratch_mount_option dax + fi case $FSTYP in btrfs) diff --git a/tests/ext4/054 b/tests/ext4/054 index 9a11719f..e23acbb1 100755 --- a/tests/ext4/054 +++ b/tests/ext4/054 @@ -19,7 +19,6 @@ _begin_fstest auto quick dangerous_fuzzers # real QA test starts here _supported_fs ext4 -_require_test _require_scratch_nocheck _require_xfs_io_command "falloc" _require_xfs_io_command "pwrite" @@ -28,8 +27,8 @@ _require_xfs_io_command "fpunch" _require_command "$DEBUGFS_PROG" debugfs # In order to accurately construct the damaged extent in the following -# test steps, the blocksize is set to 1024 here -_scratch_mkfs "-b 1024" > $seqres.full 2>&1 +# test steps, the block size is set to 1024 here +_scratch_mkfs_blocksized 1024 >> $seqres.full 2>&1 _scratch_mount TEST_FILE="${SCRATCH_MNT}/testfile" From patchwork Tue Jun 28 18:25:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 12898706 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 64B16C43334 for ; Tue, 28 Jun 2022 18:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232422AbiF1SZ6 (ORCPT ); Tue, 28 Jun 2022 14:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233882AbiF1SZz (ORCPT ); Tue, 28 Jun 2022 14:25:55 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B30352125C for ; Tue, 28 Jun 2022 11:25:54 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-118-63.bstnma.fios.verizon.net [173.48.118.63]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 25SIPoD6025938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 14:25:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656440752; bh=NDZVyZ5gvfyrcqKY2Brg3MnGgp5+uwqYZsM4M2WU+xg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Qo2k4YgALuqs21bZkVDwrxU4zdRD9JpwVxLJ1gZdiPHKW7eWEudhtvn3lr1TDbQa4 NLW1Fc3ph52JNJm3GgUl/G/u5fLU871EyIyKo2b2QCVozuWbSUoHARJdRdmlmKdMS0 N8+fTygd7ev5wH60LF3U+ZAP4fpTND1BlP7xOyNg4UqITqU6a9hssnlHawJX/2yEzd vk9b2FIhgoJK5x0mRU2//Y1QutAmIwA0VhLH8FndxjXuKkw+/ZsiAUtsE0Q10puL/w 5MarnuksjltMooDxbuk910sz4vhDn2MFg81lZKVoutoZP3dgwvIDRQZPIRVqVZhdCn ekb68Tg08Nihw== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 8380C15C4318; Tue, 28 Jun 2022 14:25:49 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" Subject: [PATCH 5/6] ext4/055: skip test if dax mount option is used Date: Tue, 28 Jun 2022 14:25:44 -0400 Message-Id: <20220628182545.1834145-6-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220628182545.1834145-1-tytso@mit.edu> References: <20220628182545.1834145-1-tytso@mit.edu> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This test creates a 1k block file system with the quota feature enabled. As such, it is incompatible with DAX. Signed-off-by: Theodore Ts'o --- tests/ext4/055 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ext4/055 b/tests/ext4/055 index 8f466f1b..aa15cfe9 100755 --- a/tests/ext4/055 +++ b/tests/ext4/055 @@ -26,6 +26,7 @@ _require_command "$DEBUGFS_PROG" debugfs echo "Silence is golden" # The 1K blocksize is designed for debugfs. +_exclude_scratch_mount_option dax _scratch_mkfs "-F -O quota -b 1024" > $seqres.full 2>&1 # Start from 0, fill block 1 with 6,replace the original 2. From patchwork Tue Jun 28 18:25:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 12898708 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 63893CCA481 for ; Tue, 28 Jun 2022 18:26:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233882AbiF1S0A (ORCPT ); Tue, 28 Jun 2022 14:26:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234798AbiF1SZ4 (ORCPT ); Tue, 28 Jun 2022 14:25:56 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4660921809 for ; Tue, 28 Jun 2022 11:25:55 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-118-63.bstnma.fios.verizon.net [173.48.118.63]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 25SIPoal025937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 14:25:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656440752; bh=Q1dLm4XjO9MNVOJ+UzDPNE976l4SJ7HkSw/vRvGDP5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YmbDzZ1z9rD6YTv5QvOfNNHPyIXAotNPeCYZvFhB82peYYj0B8Lrc3EG342y0rjYl TgKRjkVkDbXl1N52t8nruKAAM18wqlWQ2IopaaDvbaVkvki5I6NEid+YVep1JwDdKQ ZkhitkzIXyLzgkDRfuqPoTD2as5XUbStYR+AGyYLWyeiQEU5p1RdeSOyuPK5FtGobC 4OALLOmkgcjXPHD+Uwy8iHP1eePMO2MLweQdDx6x+cTLloFWkxJtw4QuJEEdxDemfE qDOyJ9v18bR2tQUsF64YaN0+RTDF0hDAQ+Nzxjnv2UWC7hRWpdaUd/7zjlCcULTAAn a93qmEWAXfS/w== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 8566D15C4319; Tue, 28 Jun 2022 14:25:49 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" Subject: [PATCH 6/6] ext4: create file systems with the enrypt feature if necessary Date: Tue, 28 Jun 2022 14:25:45 -0400 Message-Id: <20220628182545.1834145-7-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220628182545.1834145-1-tytso@mit.edu> References: <20220628182545.1834145-1-tytso@mit.edu> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org The linux kernel commit 5f41fdaea63d ("ext4: only allow test_dummy_encryption when supported") the kernel will reject mounts with the test_dummy_encryption option if the ext4 file system does not have the encrypt feature enabled. There are a handful of tests (ext4/003, ext4/035, ext4/306, and generic/260) which will format the scratch file system using a hard-coded set of mkfs.ext4 parameters ignoring the MKFS_OPTION that is set by the file system test config. For file system config that includes test_dummy_encryption in MOUNT_OPTIONS and "-O encrypt" in MKFS_OPTIONS, we need to test for test_dummy_encryption and force the hard-coded mkfs options to enable the encrypt feature. Signed-off-by: Theodore Ts'o --- tests/ext4/003 | 6 +++++- tests/ext4/035 | 5 ++++- tests/ext4/306 | 3 +++ tests/generic/260 | 5 ++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/ext4/003 b/tests/ext4/003 index 773bcb03..6a4518e3 100755 --- a/tests/ext4/003 +++ b/tests/ext4/003 @@ -27,7 +27,11 @@ _require_scratch _require_scratch_ext4_feature "bigalloc" BLOCK_SIZE=$(get_page_size) -$MKFS_EXT4_PROG -F -b $BLOCK_SIZE -O bigalloc -C $(($BLOCK_SIZE * 16)) -g 256 $SCRATCH_DEV 512m \ +FEATURES=bigalloc +if echo "${MOUNT_OPTIONS}" | grep -q 'test_dummy_encryption' ; then + FEATURES=${FEATURES},encrypt +fi +$MKFS_EXT4_PROG -F -b $BLOCK_SIZE -O ${FEATURES} -C $(($BLOCK_SIZE * 16)) -g 256 $SCRATCH_DEV 512m \ >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/035 b/tests/ext4/035 index 1f26e766..a1ccce45 100755 --- a/tests/ext4/035 +++ b/tests/ext4/035 @@ -25,7 +25,10 @@ _require_scratch _exclude_scratch_mount_option dax _require_command "$RESIZE2FS_PROG" resize2fs -$MKFS_EXT4_PROG -F -b 1024 -E "resize=262144" $SCRATCH_DEV 32768 >> $seqres.full 2>&1 +if echo "${MOUNT_OPTIONS}" | grep -q 'test_dummy_encryption' ; then + ENCRYPT="-O encrypt" +fi +$MKFS_EXT4_PROG -F -b 1024 -E "resize=262144" $ENCRYPT $SCRATCH_DEV 32768 >> $seqres.full 2>&1 if [ $? -ne 0 ]; then _notrun "Can't make file system with a block size of 1024" fi diff --git a/tests/ext4/306 b/tests/ext4/306 index 2ff88537..a6b7eab5 100755 --- a/tests/ext4/306 +++ b/tests/ext4/306 @@ -33,6 +33,9 @@ features="^extents" if grep -q 64bit /etc/mke2fs.conf ; then features="^extents,^64bit" fi +if echo "${MOUNT_OPTIONS}" | grep -q 'test_dummy_encryption' ; then + features=${features},encrypt +fi blksz=$(get_page_size) diff --git a/tests/generic/260 b/tests/generic/260 index b4d72e0f..e86afe9c 100755 --- a/tests/generic/260 +++ b/tests/generic/260 @@ -120,7 +120,10 @@ case $FSTYP in bsize=4096 start=$(_math "$base*$agsize*$bsize") len=$start - export MKFS_OPTIONS="-F -b $bsize -g $agsize" + if echo "${MOUNT_OPTIONS}" | grep -q 'test_dummy_encryption' ; then + ENCRYPT="-O encrypt" + fi + export MKFS_OPTIONS="-F -b $bsize -g $agsize $ENCRYPT" ;; xfs) agsize=65538