From patchwork Thu Jun 30 14:46:31 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: 12901957 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 76793CCA480 for ; Thu, 30 Jun 2022 14:46:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232297AbiF3Oqr (ORCPT ); Thu, 30 Jun 2022 10:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230363AbiF3Oqp (ORCPT ); Thu, 30 Jun 2022 10:46:45 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 457E11C12A for ; Thu, 30 Jun 2022 07:46:44 -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 25UEkd5A005643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Jun 2022 10:46:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656600400; bh=Uco/WluYMNn3eCmZiQEHi6LM0F4ScJpfvUiF1cap0Uw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FTcBZKztYD+XU1Qm7X4QY0NPBiFJ+DqfleAHLkODeq0qA7GIfbowGnEd9bB6dHNrB L+iFOY/6NVWUL1oV4Vu7ds1j0UmhfME0otKu9fsggWNq51UM3xaYAaS+BJ2AvsTxt+ x8WxiPhs3ObIAXL4myDSX4t39omJhef4NPLFEo1BIM0QO/vM9QMDtAyHnJajDQ0G5Y uW7Fj/SsPjvviXYB24Z2XqT7H+cm2WO/HgCKR2lrcx2wrujMzpDIbsQiBlbKUo+CwP InalTpuyReuJlpVE/czeD5qFHEIH4LwGcvraeV42biQfjjXQnOl16akoOvsXO99gSA jAcRlvk0C/riQ== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 444EF15C432B; Thu, 30 Jun 2022 10:46:39 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH -v4 1/7] ext4/050: support indirect as well as extent mapped journals Date: Thu, 30 Jun 2022 10:46:31 -0400 Message-Id: <20220630144637.478568-2-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220630144637.478568-1-tytso@mit.edu> References: <20220630144637.478568-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 Thu Jun 30 14:46:32 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: 12901954 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 20DE4C43334 for ; Thu, 30 Jun 2022 14:46:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235255AbiF3Oqr (ORCPT ); Thu, 30 Jun 2022 10:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232297AbiF3Oqp (ORCPT ); Thu, 30 Jun 2022 10:46:45 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F5D31C13C for ; Thu, 30 Jun 2022 07:46:44 -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 25UEkdIL005648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Jun 2022 10:46:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656600400; bh=OKUO3qmv5wlwfMCWmEO6JQFe+sIB9qrZ4gUMvU0UBBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GFHtDZnjqqk08H+rOL8cdCSSkg2AzqqWxA5BwHc1CXWNEZbGjNteeCcyxhJvgYTvA 8YOWS4OZUzsAisl6BlDqlfqKr5UdZJLvQMBDhIQN2ZeZFzdprKjqqY5nhuVas1YI4x cGXUUuwuF6PPZsGH+ECmJAWolpVQItqFPKR9XSswv8A2vooIUwXceXOQtKx6Hj+3yC JB/sDXOCVb1iIUdXb5lZXdyU8bHl9zWO5zHWk+DR0ygE6mkrDhbQCSbX8RbfGV9WhL YcDcanfB7Dv3QiYzoZ+Nmldu1rJqva0XzxCBAW1pUMb/g4jnSAcYav2dj2yoDZeUvo 4LYg6W7zT2XsA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 4681D15C432C; Thu, 30 Jun 2022 10:46:39 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH -v4 2/7] ext4/044: skip test if the file system does not have a journal Date: Thu, 30 Jun 2022 10:46:32 -0400 Message-Id: <20220630144637.478568-3-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220630144637.478568-1-tytso@mit.edu> References: <20220630144637.478568-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 Reviewed-by: Zorro Lang --- 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 Thu Jun 30 14:46:33 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: 12901955 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 F10D5CCA47B for ; Thu, 30 Jun 2022 14:46:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230363AbiF3Oqs (ORCPT ); Thu, 30 Jun 2022 10:46:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233782AbiF3Oqp (ORCPT ); Thu, 30 Jun 2022 10:46:45 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92E561C900 for ; Thu, 30 Jun 2022 07:46:44 -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 25UEkdq7005649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Jun 2022 10:46:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656600400; bh=1+Vnv4j89PKGRYGm1qoLshwFGEmKo3YRJsS/explSso=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nwfq2Ooy+VzgcCiO+dahnQsCUGmogJ4SlQflCXNL+O3UOC79gYbPUc1lG1gLbA99d eI7NEhPhyxoH43OKJYz6cABSVtNP4rLIs4zqt/OVxU2iK1qaS20GSC4omPXh5fRHxY 3uslqoa4bXdoFq1K4bvIM/dYMohT8Mh8MqGcFxcqRaC1Jmu8MuJZyy1owdcDGZmDbc 9aaKCamSzYYmcD6esm9b6FYWJURD0NnR47VwcCrXmu8wCHxZXsnnjrndZmPpb9f5FK mchO12Jm1CTXYeG+k9T0B8cu7BJjEEG6a9enA7RPNua1aUPDkGzV+LUVM+oy9cs9Sk 5bGY3I/olr9wg== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 4866015C432E; Thu, 30 Jun 2022 10:46:39 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH -v4 3/7] ext4/045: _require_dumpe2fs doesn't take any arguments so remove them Date: Thu, 30 Jun 2022 10:46:33 -0400 Message-Id: <20220630144637.478568-4-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220630144637.478568-1-tytso@mit.edu> References: <20220630144637.478568-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 Reviewed-by: Zorro Lang --- 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 Thu Jun 30 14:46:34 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: 12901956 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 87BDDCCA481 for ; Thu, 30 Jun 2022 14:46:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233782AbiF3Oqs (ORCPT ); Thu, 30 Jun 2022 10:46:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234996AbiF3Oqp (ORCPT ); Thu, 30 Jun 2022 10:46:45 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0481C926 for ; Thu, 30 Jun 2022 07:46:44 -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 25UEkdIC005658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Jun 2022 10:46:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656600400; bh=2yLLJtETHLber272kFlagdGoN7x6KydHhAf7PrS3Wrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iyN46H9Z8szwfZoyRGqlkTVvVlFYiVteWwisc1OLZuAeZAqWyRfPI8KC5cmi/LHaA /DcSZq0833F3bCTuFlItZF+1MH8KtB6Tl4oBLdmqJO8nEk5I3xSPEOBl6MD1LEqPpz wTSQQpoIzhfOMKz5sJVyP08KcwGDZ6XAj2lLfyob0dl4qw+3jgt9E5ehVik37/+DuB zk47XcGhsyULgCJ4ZW7w6ROLMQYWvUztGrOUA/ZIqfxn1pR9T5YvuUU6KcYrUgkkwr vxJupS9X3EdxZq7beLgOloXnU3IgVp5/cKfwr6VDgXtIXwcoEhkKFjRlNwYZNJBL0W pOz15yPTwrvZg== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 4ABDA15C432F; Thu, 30 Jun 2022 10:46:39 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH -v4 4/7] ext4/054: skip test if the dax mount option is enabled Date: Thu, 30 Jun 2022 10:46:34 -0400 Message-Id: <20220630144637.478568-5-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220630144637.478568-1-tytso@mit.edu> References: <20220630144637.478568-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 3c072c16..b608d2f6 100644 --- a/common/rc +++ b/common/rc @@ -1199,6 +1199,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 Thu Jun 30 14:46:35 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: 12901959 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 51B53C43334 for ; Thu, 30 Jun 2022 14:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234403AbiF3Oqt (ORCPT ); Thu, 30 Jun 2022 10:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbiF3Oqq (ORCPT ); Thu, 30 Jun 2022 10:46:46 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ADA71C12A for ; Thu, 30 Jun 2022 07:46:46 -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 25UEkeW6005677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Jun 2022 10:46:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656600402; bh=yf7Y0BGdOqfJn7l0dlt2/87VQnD1Mws0E4mKBd/PwtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VZ0cADXvGMSUiFE6Omq3ly5wxLaGTIOKq7qya4IQFKFUiNASN6jB3DUVqRIYXlmRJ /BcoHqf/My9r1lMzvecaxgjmFiTthMjkUiZ+O5X3u05CNsyFW+JDcJa9SVdBCiy1eB d90KivtsqMFQHo/gpcXYTw1GEtrgWbDKyZ0DBwB0cVbMsspkp6KI96sylc/97M9Qy8 a524hOP8P6k/XQL/tjdJSNfuOPmj2WOn45uuGhc8MzA+2F0pWTaGJGeEqyOrQnMmr9 /W9fbhyqkqaxRyL5cFAVbOOOdq6Xd+3WsrDxddZiB87dBlKG1LpZ6R9SWj/vaZcBJ+ jotM7gEpMETQQ== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 4C9C215C4330; Thu, 30 Jun 2022 10:46:39 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH -v4 5/7] ext4/055: skip test if dax mount option is used Date: Thu, 30 Jun 2022 10:46:35 -0400 Message-Id: <20220630144637.478568-6-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220630144637.478568-1-tytso@mit.edu> References: <20220630144637.478568-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 Reviewed-by: Zorro Lang --- 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 Thu Jun 30 14:46:36 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: 12901958 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 05062C433EF for ; Thu, 30 Jun 2022 14:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235311AbiF3Oqt (ORCPT ); Thu, 30 Jun 2022 10:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234403AbiF3Oqp (ORCPT ); Thu, 30 Jun 2022 10:46:45 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D900D1C90D for ; Thu, 30 Jun 2022 07:46:44 -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 25UEkeUA005678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Jun 2022 10:46:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656600402; bh=z9Fw7MNJriX6yITdhWlqeExe4BF1WfQkL4Fa/IoV6tY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JbhBwqVyyIiv5M61SIUMbGqj5EcqjIVE8DSCFnCq2SU9AtsKXHNPWIEAUZZmHgOFU /cGK4he5RPD6GDjK12mcTu3z+ZZWLJUL0vCkwOE+THqhniZyVlFnnci6Qio2X48TpG 87YZe4nNlAkNW0mrtNjKMvVFZXxJnDVvrjtjxLq6QTehJy1mdm+REbKjI2iw6jZU4Y S+3k8tJ5VvPoUXkR1ZuM5vQvNoe/HV8oeOEIizWhP+xDGrIkBDvl+Lk90mHdlozUAo vs7s4i3tEeTcXP40vSoZ4SMDf7k6v1VDHPT4QiUqeAFh/MddDjhKKX1jruksmPM2SZ RWt7A11JhPhvw== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 4ED0015C4331; Thu, 30 Jun 2022 10:46:39 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH -v4 6/7] ext4/035: skip this test if the scratch device does not support 1k block sizes Date: Thu, 30 Jun 2022 10:46:36 -0400 Message-Id: <20220630144637.478568-7-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220630144637.478568-1-tytso@mit.edu> References: <20220630144637.478568-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 Reviewed-by: Zorro Lang --- tests/ext4/035 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/ext4/035 b/tests/ext4/035 index cad3595b..1f26e766 100755 --- a/tests/ext4/035 +++ b/tests/ext4/035 @@ -26,6 +26,9 @@ _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 [ $? -ne 0 ]; then + _notrun "Can't make file system with a block size of 1024" +fi _scratch_mount echo "Resizing to 262145 blocks" From patchwork Thu Jun 30 14:46:37 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: 12901960 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 E0D30CCA483 for ; Thu, 30 Jun 2022 14:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbiF3Oqu (ORCPT ); Thu, 30 Jun 2022 10:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235205AbiF3Oqq (ORCPT ); Thu, 30 Jun 2022 10:46:46 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AEDD1C127 for ; Thu, 30 Jun 2022 07:46:45 -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 25UEkeGU005696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Jun 2022 10:46:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1656600402; bh=qhRE+8WpIYRPZYCoOSgC7za5IujOiBo9qnX6m0IG9+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Rs6GTk9yVnAMnEfxpedHXRIeR4lmGBMvvGEuPYzf7RU2ot3s95YBXSmBLMLHviPGW W4KHEqM/dHEUXdc3B6AtDgJJTWFwa7RyiwMfzyTsAYX77Kxgl9je5kD/A75h51O0Z6 9e7NC7E7sXRj+iaP9JqtpbwlyNKqxmzrW/ODRXGlVj5uXe0N9Td6jCIuQxl1Nssg56 tPmVT9z3784hc+9sCqJGdIgXR6//hRBcXnz9to2e6e8IrVl/IBmlWosl1WlTpvhvG6 u9QFFP3TTc7EcU3p4v7ApBfO/UAbxKJO8IGPyDEztFuBSmasS26zRz0Gt4T3O14imf NzJsoBv35QyvA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 50C6515C4333; Thu, 30 Jun 2022 10:46:39 -0400 (EDT) From: "Theodore Ts'o" To: fstests@vger.kernel.org Cc: "Theodore Ts'o" , Zorro Lang Subject: [PATCH -v4 7/7] ext4: create file systems with the encrypt feature as necessary Date: Thu, 30 Jun 2022 10:46:37 -0400 Message-Id: <20220630144637.478568-8-tytso@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220630144637.478568-1-tytso@mit.edu> References: <20220630144637.478568-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 configs which 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 Reviewed-by: Zorro Lang --- tests/ext4/003 | 6 +++++- tests/ext4/035 | 6 +++++- tests/ext4/306 | 5 ++++- tests/generic/260 | 3 +++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/ext4/003 b/tests/ext4/003 index 773bcb03..8ac467b8 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+=",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..a8278b0e 100755 --- a/tests/ext4/035 +++ b/tests/ext4/035 @@ -25,7 +25,11 @@ _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 +encrypt= +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..db256284 100755 --- a/tests/ext4/306 +++ b/tests/ext4/306 @@ -31,7 +31,10 @@ _require_command "$RESIZE2FS_PROG" resize2fs # Make a small ext4 fs with extents disabled & mount it features="^extents" if grep -q 64bit /etc/mke2fs.conf ; then - features="^extents,^64bit" + features+=",^64bit" +fi +if echo "${MOUNT_OPTIONS}" | grep -q 'test_dummy_encryption' ; then + features+=",encrypt" fi blksz=$(get_page_size) diff --git a/tests/generic/260 b/tests/generic/260 index b4d72e0f..2f653b4a 100755 --- a/tests/generic/260 +++ b/tests/generic/260 @@ -121,6 +121,9 @@ case $FSTYP in 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 + MKFS_OPTIONS+=" -O encrypt" + fi ;; xfs) agsize=65538