From patchwork Wed Dec 27 13:53:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508505 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F06327F9; Mon, 1 Jan 2024 00:53:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="djlH5oof" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70683C433C7; Mon, 1 Jan 2024 00:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070382; bh=2Rc2nLnzg8//0iSKEFqfSst3P2h/y98MDXd5+yGNIdk=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=djlH5oofdWNexzL41j2OiYRZ/QVdmUVBTxeSoAGV6t6YxVKtEFIGDXMBfzElk6/30 lAvwF8py4nroE37Dn5TRqUs80SYDKcy8sYZHWj8opPa00sY0ZF3vbC58Qaq+2oHwYT HsS6YJkU9v4/v/4oEIVhrTpixvqOZhtYcy++kVzJb4JW5dENw12aDnWFEagN5/cjwZ aPBbLCXSzNB8lAqY2hh8dfHTqwbQ9RQTUZZdUiDuoYuJri7ZPu4wviH1c8J/LRW6qf AXhqUdSoIxPIBg2EI4hOq3lY54xIEk9YbhBX3aLHlFlRX4L6esLYA2MgLYb/cBQIBW vvGmicH+ePeZg== Date: Sun, 31 Dec 2023 16:53:02 +9900 Subject: [PATCH 01/17] common/populate: refactor caching of metadumps to a helper From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030350.1826350.18345503384695892303.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Hoist out of _scratch_populate_cached all the code that we use to save a metadump of the populated filesystem. We're going to make this more involved for XFS in the next few patches so that we can take advantage of the new support for external devices in metadump/mdrestore. Signed-off-by: Darrick J. Wong --- common/populate | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/common/populate b/common/populate index 83cd0eb5db..72c88e0651 100644 --- a/common/populate +++ b/common/populate @@ -1047,6 +1047,31 @@ _scratch_populate_restore_cached() { return 1 } +# Take a metadump of the scratch filesystem and cache it for later. +_scratch_populate_save_metadump() +{ + local metadump_file="$1" + + case "${FSTYP}" in + "xfs") + local logdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + logdev=$SCRATCH_LOGDEV + + _xfs_metadump "$metadump_file" "$SCRATCH_DEV" "$logdev" \ + compress + res=$? + ;; + "ext2"|"ext3"|"ext4") + _ext4_metadump "${SCRATCH_DEV}" "${metadump_file}" compress + res=$? + ;; + *) + _fail "Don't know how to save a ${FSTYP} filesystem." + esac + return $res +} + # Populate a scratch FS from scratch or from a cached image. _scratch_populate_cached() { local meta_descr="$(_scratch_populate_cache_tag "$@")" @@ -1070,26 +1095,20 @@ _scratch_populate_cached() { # Oh well, just create one from scratch _scratch_mkfs - echo "${meta_descr}" > "${populate_metadump_descr}" case "${FSTYP}" in "xfs") _scratch_xfs_populate $@ _scratch_xfs_populate_check - - local logdev=none - [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ - logdev=$SCRATCH_LOGDEV - - _xfs_metadump "$POPULATE_METADUMP" "$SCRATCH_DEV" "$logdev" \ - compress ;; "ext2"|"ext3"|"ext4") _scratch_ext4_populate $@ _scratch_ext4_populate_check - _ext4_metadump "${SCRATCH_DEV}" "${POPULATE_METADUMP}" compress ;; *) _fail "Don't know how to populate a ${FSTYP} filesystem." ;; esac + + _scratch_populate_save_metadump "${POPULATE_METADUMP}" && \ + echo "${meta_descr}" > "${populate_metadump_descr}" } From patchwork Wed Dec 27 13:53:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508506 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53C177EE; Mon, 1 Jan 2024 00:53:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="U3C4JRiD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 208FFC433C8; Mon, 1 Jan 2024 00:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070398; bh=JrNNoZs4D4FgDGNVqNZm1bXpsajWMe9ooFf8O9bwEk0=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=U3C4JRiDUALn790u4GLFx1eQ1BPtYHu4e2mAzk52AmtmBchMHRasuqqffzohfdEsB c7eDeq5nUGDT5VEbFeOMmv2FOmLshw28Bm/C4swNE7yYqsbYRUZOcPHAQp0ju2RukY RI7cgR1Y518e3WCnlroU+txrk1jD4AEI+CROVDn+N2XWs93f7e/nCdyH7BMt/tW+TJ bL+Cx8Y6/f4Jfn1yzXtzUAE0zccWO51j3YxPWPdN67bG39/Kx6mKzRnV/NmWZ+fpMy 2xtdHOdRTBgazDnDtXKPmskT/T81DaiJ/RcC34n5QUJBPzwcpg+rFncAMwSGAMf8RI o3QpUiwib2/0Q== Date: Sun, 31 Dec 2023 16:53:17 +9900 Subject: [PATCH 02/17] common/xfs: wipe external logs during mdrestore operations From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030363.1826350.16500443816959304020.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong The XFS metadump file format doesn't support the capture of external log devices, which means that mdrestore ought to wipe the external log and run xfs_repair to rewrite the log device as needed to get the restored filesystem to work again. The common/populate code could already do this, so push it to the common xfs helper. While we're at it, fix the uncareful usage of SCRATCH_LOGDEV in the populate code. Signed-off-by: Darrick J. Wong --- common/fuzzy | 7 ++++++- common/populate | 19 ++++++------------- common/xfs | 21 +++++++++++++++++++-- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/common/fuzzy b/common/fuzzy index b72b4a9fe7..b72ee3f67f 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -304,7 +304,12 @@ __scratch_xfs_fuzz_unmount() __scratch_xfs_fuzz_mdrestore() { __scratch_xfs_fuzz_unmount - _xfs_mdrestore "${POPULATE_METADUMP}" "${SCRATCH_DEV}" || \ + + local logdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + logdev=$SCRATCH_LOGDEV + + _xfs_mdrestore "${POPULATE_METADUMP}" "${SCRATCH_DEV}" "${logdev}" || \ _fail "${POPULATE_METADUMP}: Could not find metadump to restore?" } diff --git a/common/populate b/common/populate index 72c88e0651..92a3c5e354 100644 --- a/common/populate +++ b/common/populate @@ -1011,21 +1011,14 @@ _scratch_populate_cache_tag() { _scratch_populate_restore_cached() { local metadump="$1" + local logdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + logdev=$SCRATCH_LOGDEV + case "${FSTYP}" in "xfs") - _xfs_mdrestore "${metadump}" "${SCRATCH_DEV}" - res=$? - test $res -ne 0 && return $res - - # Cached images should have been unmounted cleanly, so if - # there's an external log we need to wipe it and run repair to - # format it to match this filesystem. - if [ -n "${SCRATCH_LOGDEV}" ]; then - $WIPEFS_PROG -a "${SCRATCH_LOGDEV}" - _scratch_xfs_repair - res=$? - fi - return $res + _xfs_mdrestore "${metadump}" "${SCRATCH_DEV}" "${logdev}" + return $? ;; "ext2"|"ext3"|"ext4") _ext4_mdrestore "${metadump}" "${SCRATCH_DEV}" diff --git a/common/xfs b/common/xfs index b88491666d..77ba786ece 100644 --- a/common/xfs +++ b/common/xfs @@ -683,7 +683,8 @@ _xfs_metadump() { _xfs_mdrestore() { local metadump="$1" local device="$2" - shift; shift + local logdev="$3" + shift; shift; shift local options="$@" # If we're configured for compressed dumps and there isn't already an @@ -697,6 +698,18 @@ _xfs_mdrestore() { test -r "$metadump" || return 1 $XFS_MDRESTORE_PROG $options "${metadump}" "${device}" + res=$? + test $res -ne 0 && return $res + + # mdrestore does not know how to restore an external log. If there is + # one, we need to erase the log header and run xfs_repair to format a + # new log header onto the log device. + if [ "$logdev" != "none" ]; then + $XFS_IO_PROG -d -c 'pwrite -S 0 -q 0 1m' "$logdev" + _scratch_xfs_repair >> $seqres.full 2>&1 + res=$? + fi + return $res } # Snapshot the metadata on the scratch device @@ -718,7 +731,11 @@ _scratch_xfs_mdrestore() local metadump=$1 shift - _xfs_mdrestore "$metadump" "$SCRATCH_DEV" "$@" + local logdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + logdev=$SCRATCH_LOGDEV + + _xfs_mdrestore "$metadump" "$SCRATCH_DEV" "$logdev" "$@" } # Do not use xfs_repair (offline fsck) to rebuild the filesystem From patchwork Wed Dec 27 13:53:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508507 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 007577EE; Mon, 1 Jan 2024 00:53:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vszl8nv+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C65EAC433C8; Mon, 1 Jan 2024 00:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070413; bh=yRAYRi0EUX+qqBBfQYRD/fyQl7iv+0V5Flu3HuygC4I=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=Vszl8nv+74bud63cSE8+Z3o5cvcrzpOgehjEWfSiMfxzur/LQXa/9JIS7I7yFBrl5 KuTV2/SKZoRNZmAxNh7kjVA15MVf/nz8dQ8A3wD32+fPxSkNdU4GIpEKW4ggbQqe92 KP9kKahJMvJaLHD/PxRebNG+ORYY1OSsEX+57vl6155SS4ibwUgzgQy+mxlZ0ztxmo OoI2GgJPoyXL/I8mXKMgSAhNxiFpEY8cI4wYuD5beD+95EDFg715uSDDmRA4rKdW7h vKMYi3ALwKEjklROtgBu6ZVqQTwZvdosZr9t1nHfdC4C/vCMLITX8976XvrH5svU62 5ED9GnMRetLAw== Date: Sun, 31 Dec 2023 16:53:33 +9900 Subject: [PATCH 03/17] common/ext4: reformat external logs during mdrestore operations From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030376.1826350.13665269303629955348.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong The e2image file format doesn't support the capture of external log devices, which means that mdrestore ought to reformat the external log to get the restored filesystem to work again. The common/populate code could already do this, so push it to the common ext4 helper. While we're at it, fix the uncareful usage of SCRATCH_LOGDEV in the populate code. Signed-off-by: Darrick J. Wong --- common/ext4 | 17 ++++++++++++++++- common/populate | 16 ++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/common/ext4 b/common/ext4 index 3dcbfe17c9..5171b8df68 100644 --- a/common/ext4 +++ b/common/ext4 @@ -134,7 +134,8 @@ _ext4_mdrestore() { local metadump="$1" local device="$2" - shift; shift + local logdev="$3" + shift; shift; shift local options="$@" # If we're configured for compressed dumps and there isn't already an @@ -148,6 +149,20 @@ _ext4_mdrestore() test -r "$metadump" || return 1 $E2IMAGE_PROG $options -r "${metadump}" "${SCRATCH_DEV}" + res=$? + test $res -ne 0 && return $res + + # ext4 cannot e2image external logs, so we have to reformat the log + # device to match the restored fs + if [ "${logdev}" != "none" ]; then + local fsuuid="$($DUMPE2FS_PROG -h "${SCRATCH_DEV}" 2>/dev/null | \ + grep 'Journal UUID:' | \ + sed -e 's/Journal UUID:[[:space:]]*//g')" + $MKFS_EXT4_PROG -O journal_dev "${logdev}" \ + -F -U "${fsuuid}" + res=$? + fi + return $res } # this test requires the ext4 kernel support crc feature on scratch device diff --git a/common/populate b/common/populate index 92a3c5e354..450b024bfc 100644 --- a/common/populate +++ b/common/populate @@ -1021,20 +1021,8 @@ _scratch_populate_restore_cached() { return $? ;; "ext2"|"ext3"|"ext4") - _ext4_mdrestore "${metadump}" "${SCRATCH_DEV}" - ret=$? - test $ret -ne 0 && return $ret - - # ext4 cannot e2image external logs, so we have to reformat - # the scratch device to match the restored fs - if [ -n "${SCRATCH_LOGDEV}" ]; then - local fsuuid="$($DUMPE2FS_PROG -h "${SCRATCH_DEV}" 2>/dev/null | \ - grep 'Journal UUID:' | \ - sed -e 's/Journal UUID:[[:space:]]*//g')" - $MKFS_EXT4_PROG -O journal_dev "${SCRATCH_LOGDEV}" \ - -F -U "${fsuuid}" - fi - return 0 + _ext4_mdrestore "${metadump}" "${SCRATCH_DEV}" "${logdev}" + return $? ;; esac return 1 From patchwork Wed Dec 27 13:53:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508508 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1660B7ED; Mon, 1 Jan 2024 00:53:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PoMiGfhu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AA34C433C7; Mon, 1 Jan 2024 00:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070429; bh=+96bOFEuTSjx1a8FjnhobJpygdjOPFotve1QilQfuqY=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=PoMiGfhuVH9GsjX+hLaq8MHtxIXufRLZYGdyTNOk3JMS45sgSgJX5OAKMB24GO4vS 2zptQ0O+FhHHcdID5U034t7e6L5s5SdnPE3dr4DySXhTAaf9q/LtCYS3g87Absicxb hTHpkvL4p9WJt7i+DcdpiUPrMaZdx47tz6OkFciIvrWqLfQi6l4Jz+3UoPQSDm5Ver 62ljW3V/Wzj0/6Wro7VOh7Zd1KsPK2DZvg6b9l+ZjQvO6pvXHz6Ero5CfPSqmoqquG R/mZfGn8KFAWThL4vda9vNOepox//8MfqLGU2kk8jzXZV/apjH/rO9gVjQLaoS/fir dulhE3PM0MpLA== Date: Sun, 31 Dec 2023 16:53:48 +9900 Subject: [PATCH 04/17] xfs: use metadump v2 format by default From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030390.1826350.13961921287983856419.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Create metadump v2 files by default. Signed-off-by: Darrick J. Wong --- common/xfs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/xfs b/common/xfs index 77ba786ece..4e8630b3ab 100644 --- a/common/xfs +++ b/common/xfs @@ -669,6 +669,14 @@ _xfs_metadump() { local options="$@" test -z "$options" && options="-a -o" + # Use metadump v2 format unless the user gave us a specific version + $XFS_METADUMP_PROG --help 2>&1 | grep -q -- '-v version' && \ + metadump_has_v2=1 + + if ! echo "$options" | grep -q -- '-v' && [ -n "$metadump_has_v2" ]; then + options="$options -v 2" + fi + if [ "$logdev" != "none" ]; then options="$options -l $logdev" fi From patchwork Wed Dec 27 13:54:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508509 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CA0D7EE; Mon, 1 Jan 2024 00:54:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="byPyrmVU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A1CFC433C7; Mon, 1 Jan 2024 00:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070445; bh=Co72ca/D7/pGEgAz19GcoPUNJACYs+E3KwqttNTgUmk=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=byPyrmVUpujO/uPxyyxCeLKYxDs1rtSdEVpvc8iGrWrPbKmNVN2LpQOQfOKJvTC1U Gr/Z/DXznEBdasAYp4Tn1ujxpjNhqiGvV4d53fhuf0cvqabSL2TTkqk8Hkp8kJNw5s TE3Z4jZeRcg2SXldXJ1WpGtr4s8+r8KDpJ0TVs/tUrA9+BywgCyoGR4nX9IrbEiQrc NKgrq5pIF4R1J02dNnVHE8bhNFbd7uQEDpD3CPSwrIThR1OLLRZpfTMB/5sOS5RbLy HDDLbXC/Nh8dlw92BXFR6BQCX1aTDfT0AMpH4DirGD54TPj1d3pPdkvxa3P/dKobAx EqTtZZvpaqu8Q== Date: Sun, 31 Dec 2023 16:54:04 +9900 Subject: [PATCH 05/17] common/xfs: capture external logs during metadump/mdrestore From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030403.1826350.4983042278295283651.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong If xfs_mdrestore supports the -l switch and there's an external scratch log, pass the option so that we can restore log contents. Signed-off-by: Darrick J. Wong --- common/xfs | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/common/xfs b/common/xfs index 4e8630b3ab..175de69c63 100644 --- a/common/xfs +++ b/common/xfs @@ -668,6 +668,7 @@ _xfs_metadump() { shift; shift; shift; shift local options="$@" test -z "$options" && options="-a -o" + local metadump_has_dash_x # Use metadump v2 format unless the user gave us a specific version $XFS_METADUMP_PROG --help 2>&1 | grep -q -- '-v version' && \ @@ -694,6 +695,12 @@ _xfs_mdrestore() { local logdev="$3" shift; shift; shift local options="$@" + local need_repair + local mdrestore_has_dash_l + + # Does mdrestore support restoring to external devices? + $XFS_MDRESTORE_PROG --help 2>&1 | grep -q -- '-l logdev' && + mdrestore_has_dash_l=1 # If we're configured for compressed dumps and there isn't already an # uncompressed dump, see if we can use DUMP_COMPRESSOR to decompress @@ -705,19 +712,38 @@ _xfs_mdrestore() { fi test -r "$metadump" || return 1 + if [ "$logdev" != "none" ]; then + # We have an external log device. If mdrestore supports + # restoring to it, configure ourselves to do that. + if [ -n "$mdrestore_has_dash_l" ]; then + options="$options -l $logdev" + fi + + # Wipe the log device. If mdrestore doesn't support restoring + # to external log devices or the metadump file doesn't capture + # the log contents, this is our only chance to signal that the + # log header needs to be rewritten. + $XFS_IO_PROG -d -c 'pwrite -S 0 -q 0 1m' "$logdev" + fi + $XFS_MDRESTORE_PROG $options "${metadump}" "${device}" res=$? test $res -ne 0 && return $res - # mdrestore does not know how to restore an external log. If there is - # one, we need to erase the log header and run xfs_repair to format a - # new log header onto the log device. + # If there's an external log, check to see if the restore rewrote the + # log header. If not, we need to run xfs_repair to format a new log + # header onto the log device. if [ "$logdev" != "none" ]; then - $XFS_IO_PROG -d -c 'pwrite -S 0 -q 0 1m' "$logdev" - _scratch_xfs_repair >> $seqres.full 2>&1 - res=$? + magic="$($XFS_IO_PROG -c 'pread -q -v 0 4' "$logdev")" + if [ "$magic" = "00000000: 00 00 00 00 ...." ]; then + need_repair=1 + fi fi - return $res + + test -z "$need_repair" && return 0 + + echo "repairing fs to fix uncaptured parts of fs." >> $seqres.full + _scratch_xfs_repair >> $seqres.full 2>&1 } # Snapshot the metadata on the scratch device From patchwork Wed Dec 27 13:54:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508510 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EFC97ED; Mon, 1 Jan 2024 00:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wp+BcVQ0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB996C433C8; Mon, 1 Jan 2024 00:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070460; bh=C0TfiZlEap7l3zpoW2EHNWrVoATyl3RYZMZXYP+DhKY=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=Wp+BcVQ0zd7T1wko80VRqAAn7dgjWcUDNwEApGmpOSr+pHmAihTtSH1Mrr4CqkCwv z1+za2YXI/CsvvPoIgGyIp2/6tlPcUiWXTMs9JsXbPMk3GughJJdqGR9paxBehtRil 9Ixo/CoWdFkmKxfyK3dP13naqomAG1dy7HDM2iOEUZYEKQGexMsTrO7kxpuSGGW0Ud glAwVntv7QUkQYESRanPWuC99n9nO3u3ZNYd4tuKqBawIruEq+HTdlg7hmFkS9zZOT NnuEaiHWCQ1bQT/kEUo/oDjvMc/FJU2vykrVreJOrBaN8qbMhAnmwpGpwe+2ag3lB9 O0wjazmaY97CA== Date: Sun, 31 Dec 2023 16:54:20 +9900 Subject: [PATCH 06/17] xfs/122: update for rtgroups From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030416.1826350.1854166515093314531.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Add our new metadata for realtime allocation groups to the ondisk checking. Signed-off-by: Darrick J. Wong --- tests/xfs/122.out | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/xfs/122.out b/tests/xfs/122.out index 430b805792..21b139d838 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -44,6 +44,9 @@ offsetof(xfs_sb_t, sb_rbmino) = 64 offsetof(xfs_sb_t, sb_rextents) = 24 offsetof(xfs_sb_t, sb_rextsize) = 80 offsetof(xfs_sb_t, sb_rextslog) = 125 +offsetof(xfs_sb_t, sb_rgblklog) = 280 +offsetof(xfs_sb_t, sb_rgblocks) = 272 +offsetof(xfs_sb_t, sb_rgcount) = 276 offsetof(xfs_sb_t, sb_rootino) = 56 offsetof(xfs_sb_t, sb_rrmapino) = 264 offsetof(xfs_sb_t, sb_rsumino) = 72 @@ -116,9 +119,11 @@ sizeof(struct xfs_refcount_key) = 4 sizeof(struct xfs_refcount_rec) = 12 sizeof(struct xfs_rmap_key) = 20 sizeof(struct xfs_rmap_rec) = 24 +sizeof(struct xfs_rtgroup_geometry) = 128 sizeof(struct xfs_rtrmap_key) = 24 sizeof(struct xfs_rtrmap_rec) = 32 sizeof(struct xfs_rtrmap_root) = 4 +sizeof(struct xfs_rtsb) = 104 sizeof(struct xfs_rud_log_format) = 16 sizeof(struct xfs_rui_log_format) = 16 sizeof(struct xfs_scrub_metadata) = 64 From patchwork Wed Dec 27 13:54:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508511 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2D441871; Mon, 1 Jan 2024 00:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="U6zl2LFJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63415C433C8; Mon, 1 Jan 2024 00:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070476; bh=9jAnSOIqQu29C0AAMA66mRn2pUBSA6wv6/vXucWwKZE=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=U6zl2LFJDg9Cr3CmRI7EmtpwegaRJ6EOMNACJ3TvWR5WoISoIOtpf71+VEhqq49zu zY+ktYvq7fsQGNN/CK/grRaGmErQxstEbWD++Xg3y4NAarPX7lLdK96K9hu8bPRroG 3KgLnY/CJw/sXUStFbFr5OHYBV3QsZI1mExG9PMGxkUvKU1ozrE4cvm82dxic5WC7O j/kBsvbAoucuwKp27O2f+2vWNGzBVoWmTp1CtUHIF3B2YF51yK5ev046+nWrfPbgAI Gg/bhpKci9wHi6yFFfFy/GqSeoHUNw9M/yMW4iyclk3CsxtDzKDRdzn17wXbTNCadc u0euGEfUZg0mA== Date: Sun, 31 Dec 2023 16:54:35 +9900 Subject: [PATCH 07/17] punch-alternating: detect xfs realtime files with large allocation units From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030429.1826350.15575708588863398953.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong For files on the XFS realtime volume, it's possible that the file allocation unit (aka the minimum size we have to punch to deallocate file blocks) could be greater than a single fs block. This utility assumed that it's always possible to punch a single fs block, but for these types of files, all that does is zeroes the page cache. While that's what most *user applications* want, fstests uses punching to fragment file mapping metadata and/or fragment free space, so adapt this test for that purpose by detecting realtime files. Signed-off-by: Darrick J. Wong --- src/punch-alternating.c | 28 +++++++++++++++++++++++++++- tests/xfs/114 | 4 ++++ tests/xfs/146 | 2 +- tests/xfs/187 | 3 ++- tests/xfs/341 | 4 ++-- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/punch-alternating.c b/src/punch-alternating.c index 18dd215197..d2bb4b6a22 100644 --- a/src/punch-alternating.c +++ b/src/punch-alternating.c @@ -20,6 +20,28 @@ void usage(char *cmd) exit(1); } +/* Compute the file allocation unit size for an XFS file. */ +static int detect_xfs_alloc_unit(int fd) +{ + struct fsxattr fsx; + struct xfs_fsop_geom fsgeom; + int ret; + + ret = ioctl(fd, XFS_IOC_FSGEOMETRY, &fsgeom); + if (ret) + return -1; + + ret = ioctl(fd, XFS_IOC_FSGETXATTR, &fsx); + if (ret) + return -1; + + ret = fsgeom.blocksize; + if (fsx.fsx_xflags & XFS_XFLAG_REALTIME) + ret *= fsgeom.rtextsize; + + return ret; +} + int main(int argc, char *argv[]) { struct stat s; @@ -82,7 +104,11 @@ int main(int argc, char *argv[]) goto err; sz = s.st_size; - blksz = sf.f_bsize; + c = detect_xfs_alloc_unit(fd); + if (c > 0) + blksz = c; + else + blksz = sf.f_bsize; mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE; for (offset = start_offset * blksz; diff --git a/tests/xfs/114 b/tests/xfs/114 index 0e8a0529ab..7ecb4d217c 100755 --- a/tests/xfs/114 +++ b/tests/xfs/114 @@ -49,6 +49,10 @@ $XFS_IO_PROG -f \ -c "pwrite -S 0x68 -b 1048576 0 $len2" \ $SCRATCH_MNT/f2 >> $seqres.full +# The arguments to punch-alternating must be specified in units of file +# allocation units, so we divide the argument by $file_blksz. We already +# verified that $blksz is congruent with $file_blksz, so the fpunch parameters +# will always align with the file allocation unit. $here/src/punch-alternating -o $((16 * blksz / file_blksz)) \ -s $((blksz / file_blksz)) \ -i $((blksz * 2 / file_blksz)) \ diff --git a/tests/xfs/146 b/tests/xfs/146 index 5090435976..5d30cd8123 100755 --- a/tests/xfs/146 +++ b/tests/xfs/146 @@ -69,7 +69,7 @@ _xfs_force_bdev realtime $SCRATCH_MNT # Allocate some stuff at the start, to force the first falloc of the ouch file # to happen somewhere in the middle of the rt volume $XFS_IO_PROG -f -c 'falloc 0 64m' "$SCRATCH_MNT/b" -$here/src/punch-alternating -i $((rextblks * 2)) -s $((rextblks)) "$SCRATCH_MNT/b" +$here/src/punch-alternating "$SCRATCH_MNT/b" avail="$(df -P "$SCRATCH_MNT" | awk 'END {print $4}')"1 toobig="$((avail * 2))" diff --git a/tests/xfs/187 b/tests/xfs/187 index 7c34d8e630..14c3b37670 100755 --- a/tests/xfs/187 +++ b/tests/xfs/187 @@ -132,7 +132,8 @@ $XFS_IO_PROG -f -c "truncate $required_sz" -c "falloc 0 $remap_sz" $SCRATCH_MNT/ # Punch out every other extent of the last two sections, to fragment free space. frag_sz=$((remap_sz * 3)) punch_off=$((bigfile_sz - frag_sz)) -$here/src/punch-alternating $SCRATCH_MNT/bigfile -o $((punch_off / fsbsize)) -i $((rtextsize_blks * 2)) -s $rtextsize_blks +rtextsize_bytes=$((fsbsize * rtextsize_blks)) +$here/src/punch-alternating $SCRATCH_MNT/bigfile -o $((punch_off / rtextsize_bytes)) # Make sure we have some free rtextents. free_rtx=$($XFS_IO_PROG -c 'statfs' $SCRATCH_MNT | grep statfs.f_bavail | awk '{print $3}') diff --git a/tests/xfs/341 b/tests/xfs/341 index 1f734c9015..7d2842b579 100755 --- a/tests/xfs/341 +++ b/tests/xfs/341 @@ -43,8 +43,8 @@ len=$((blocks * rtextsz)) echo "Create some files" $XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f1 >> $seqres.full $XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f2 >> $seqres.full -$here/src/punch-alternating -i $((2 * rtextsz_blks)) -s $rtextsz_blks $SCRATCH_MNT/f1 >> "$seqres.full" -$here/src/punch-alternating -i $((2 * rtextsz_blks)) -s $rtextsz_blks $SCRATCH_MNT/f2 >> "$seqres.full" +$here/src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full" +$here/src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full" echo garbage > $SCRATCH_MNT/f3 ino=$(stat -c '%i' $SCRATCH_MNT/f3) _scratch_unmount From patchwork Wed Dec 27 13:54:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508512 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A9232F41; Mon, 1 Jan 2024 00:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PtT6Hcfj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BD70C433C8; Mon, 1 Jan 2024 00:54:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070492; bh=33Lv/Rut4oqa7LfxmjrpCbkgeM4NUqWAHdK29d55p3s=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=PtT6HcfjAXHiG9yvxIKINhX4vfl5PX+tC62nNDW5+f+xmd7GbUo8Uau5Sk4Ntd+PH miRwPGwR9x8vJfbG0Cx4kP+u/RopQoZjCtpgGUEK4lAY5mmek29khp2WEIMYZys5iO d4ffTyuJSzHsxuLJGbN9sUSjL2mK9VsRQ4/Sak9ysnQEWe4FdSqEadZTZQovNiCi20 jRsyu4Xk0DkRk9QWVEOv43DO0+rBFMUH8RgIgePRXbAYA5kprwk+t32QWzFc8jClgo Ox09CvUIr8ULNTpySjgscpunxNGxNdDt+DsgbxWTLUFqiyz24kOZrJTXzoHBN65PJ1 EB8ahtIA4x5pA== Date: Sun, 31 Dec 2023 16:54:51 +9900 Subject: [PATCH 08/17] xfs/206: update mkfs filtering for rt groups feature From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030442.1826350.17132703785254421022.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Filter out the new mkfs lines that show the rtgroup information, since this test is heavily dependent on old mkfs output. Signed-off-by: Darrick J. Wong --- tests/xfs/206 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/xfs/206 b/tests/xfs/206 index 9fd9400daf..4aceb12715 100755 --- a/tests/xfs/206 +++ b/tests/xfs/206 @@ -66,7 +66,8 @@ mkfs_filter() -e "/.*crc=/d" \ -e "/^Default configuration/d" \ -e 's/, parent=[01]//' \ - -e '/metadir=.*/d' + -e '/metadir=.*/d' \ + -e '/rgcount=/d' } # mkfs slightly smaller than that, small log for speed. From patchwork Wed Dec 27 13:55:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508513 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDCE23C35; Mon, 1 Jan 2024 00:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TXH1WI0c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 998EFC433C8; Mon, 1 Jan 2024 00:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070507; bh=fqyySn2E9nD3lk/IWViGdvk6D97X8kWv5pt+qkoHP78=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=TXH1WI0clpllBBzuy0WQ2JxR7MaQ+O+xSjG/vP4iYaYo0jksLkAR6SEJdHCOnG1DS V2v2tNBP6lFEF8vhIVKfUDd2lWc/itKoEWjjHSHKLo4FFaUotfZ9cStb02Wn+vFBOK Xisz5ViFYjX4+Xa6Q/FENVkC/aUVtQSpIMycNGTSBwL5tsVVW3bg2KRj5vIFeQ38hN cIbHbJzjOfTJ8nHGEbFSq+dpoY3uYBlD7ibCKbf+0/62biektmw9mwptX0fP7OGZ/X AQZa+SLOKv2vC4hjzky5nxlOzfQtrJ77WVp48JsoBkfW5f1VDGim7HQPwPF5GuAL4e +7IggkgMRkhUg== Date: Sun, 31 Dec 2023 16:55:07 +9900 Subject: [PATCH 09/17] common: pass the realtime device to xfs_db when possible From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030455.1826350.17236733624947817610.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Teach xfstests to pass the realtime device to xfs_db when it supports that option. Signed-off-by: Darrick J. Wong --- common/xfs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/common/xfs b/common/xfs index 175de69c63..aa1c23dd54 100644 --- a/common/xfs +++ b/common/xfs @@ -282,10 +282,10 @@ _xfs_check() { OPTS=" " DBOPTS=" " - USAGE="Usage: xfs_check [-fsvV] [-l logdev] [-i ino]... [-b bno]... special" + USAGE="Usage: xfs_check [-fsvV] [-l logdev] [-r rtdev] [-i ino]... [-b bno]... special" OPTIND=1 - while getopts "b:fi:l:stvV" c; do + while getopts "b:fi:l:stvVR:" c; do case $c in s) OPTS=$OPTS"-s ";; t) OPTS=$OPTS"-t ";; @@ -297,6 +297,7 @@ _xfs_check() V) $XFS_DB_PROG -p xfs_check -V return $? ;; + r) DBOPTS="$DBOPTS -R $OPTARG";; esac done set -- extra $@ @@ -340,6 +341,10 @@ _scratch_xfs_db_options() SCRATCH_OPTIONS="" [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV" + if [ "$USE_EXTERNAL" = yes ] && [ ! -z "$SCRATCH_RTDEV" ]; then + $XFS_DB_PROG --help 2>&1 | grep -q -- '-R rtdev' && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -R$SCRATCH_RTDEV" + fi echo $SCRATCH_OPTIONS $* $SCRATCH_DEV } @@ -404,6 +409,11 @@ _scratch_xfs_check() SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV" [ "$LARGE_SCRATCH_DEV" = yes ] && \ SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t" + if [ "$USE_EXTERNAL" = yes ] && [ ! -z "$SCRATCH_RTDEV" ]; then + $XFS_DB_PROG --help 2>&1 | grep -q -- '-R rtdev' || \ + _notrun 'xfs_db does not support rt devices' + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -R$SCRATCH_RTDEV" + fi _xfs_check $SCRATCH_OPTIONS $* $SCRATCH_DEV } From patchwork Wed Dec 27 13:55:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508514 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B373B46AF; Mon, 1 Jan 2024 00:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OZYHcYpx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 483B3C433C8; Mon, 1 Jan 2024 00:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070523; bh=TFHfFp5R+n6VDl1cv6NJ1GP3REczsII2TNse8afcsOw=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=OZYHcYpxKgjFNPOpUKGwo4EUo/iMITs6pX/uE7c8ln7nFV3fC6Qkot4d70tZv8zNu PVVlL3JnsEH3D/7Twlm8PwbrcN8uuG83R6OwWxX4bAI0gJe1rHnwUE8KE3HdyZIgur a5cXdHgwicq8IIngedVYccZkTaNHUC/IJ8YBfpFayRdl84esLR8YcWBphnS2RGVYzi Lw7QkA/enntZ+w1A4LMFTxlmuPF6DVbN9uEiNQRtdILHRoC26doTU0CyL6B2UDHido PDy3L4zMh00SNsrIKHBEh+YMtvDDk7Rek2C2W0MnrFH2pY5sESE9HbnARZrDI3KgkY C0p55PMN2/Dbw== Date: Sun, 31 Dec 2023 16:55:22 +9900 Subject: [PATCH 10/17] common: filter rtgroups when we're disabling metadir From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030468.1826350.14174130190423885732.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong If we're forcing a filesystem to be created without the metadir feature, we should forcibly disable rtgroups as well. Signed-off-by: Darrick J. Wong --- common/xfs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/xfs b/common/xfs index aa1c23dd54..e66e11f15d 100644 --- a/common/xfs +++ b/common/xfs @@ -1936,6 +1936,10 @@ _scratch_xfs_find_metafile() # Force metadata directories off. _scratch_xfs_force_no_metadir() { + if echo "$MKFS_OPTIONS" | grep -q 'rtgroups='; then + MKFS_OPTIONS="$(echo "$MKFS_OPTIONS" | sed -e 's/rtgroups=\([01]\)/rtgroups=0/g')" + fi + if echo "$MKFS_OPTIONS" | grep -q 'metadir='; then MKFS_OPTIONS="$(echo "$MKFS_OPTIONS" | sed -e 's/metadir=\([01]\)/metadir=0/g')" return From patchwork Wed Dec 27 13:55:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508515 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E30C4A03; Mon, 1 Jan 2024 00:55:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Bc3zUwwU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04B5DC433C7; Mon, 1 Jan 2024 00:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070539; bh=wsqC3D7LUO/WzeJWOdHsFQhiOxAWi4EJ1NZMu3PLVgo=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=Bc3zUwwUu0+nL95YdO4AUM/hIm9nqXTcZXzo/tz6OGxKX/mnwBRAAdBmmhFWTbmpN t02tp+C2EPhOoxIZxYJrSyxFbWKY6mw5VvotEAxhVn5LtzRNrf4fMG3tLKGJPAt1DG qIwjBmd42ed7bL3Y6+94iFSk1VufnGNNRbXSOx/eKZ0pv+FfFTibqfYcY10Kx1GKOW E2RUXFAPO5o0P/pBpfISxwSLpJ/Er8leqk/pG/A0ngnxY6OhpMSwdxOM4dgd/NDm2G I9XwD+ttrLUl7hW3pEO7JSaemg3MfEk/G8582gOQzHw8ufUcMTNI7n7ZvOUb7SFNVz TuLfQLedVMUMg== Date: Sun, 31 Dec 2023 16:55:38 +9900 Subject: [PATCH 11/17] xfs/185: update for rtgroups From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030481.1826350.1992373630394927074.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Send the fallocate results to seqres.full, since it doesn't matter if the call fails as long as we get the layout that we wanted. This test already has code to check the layout, so there's no point in failing on random ENOSPC errors. Signed-off-by: Darrick J. Wong --- tests/xfs/185 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/185 b/tests/xfs/185 index abeb052580..04770fd6c9 100755 --- a/tests/xfs/185 +++ b/tests/xfs/185 @@ -100,7 +100,7 @@ test "$ddbytes" -lt "$((rtbytes + (10 * rtextsize) ))" || \ # easy because fallocate for the first rt file always starts allocating at # physical offset zero. alloc_rtx="$((rtbytes / rtextsize))" -$XFS_IO_PROG -c "falloc 0 $((alloc_rtx * rtextsize))" $rtfile +$XFS_IO_PROG -c "falloc 0 $((alloc_rtx * rtextsize))" $rtfile &>> $seqres.full expected_end="$(( (alloc_rtx * rtextsize - 1) / 512 ))" From patchwork Wed Dec 27 13:55:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508516 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3586E4A02; Mon, 1 Jan 2024 00:55:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AyW60qky" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F015C433C8; Mon, 1 Jan 2024 00:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070554; bh=9r3YWrd97eMRBfrifUnTj7hpJqxR5akt/XOxxgrKmGA=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=AyW60qkymBz3WOAphUlCmOk+8FtBQ4exfaay0TutvFi4/VcqlPI1+WS9l7QhtJ+vv lsUdYddkLbwwCVkY65ssvjrBdnElegPHCYFwVi2EU14JpHtCiOgchc2y41ld1OwWx7 dY42g35QsINqejdwIu0ZV5EDSKYERYXdwivaOccEYxeZ5opY5RXHzfsNmblCSJpoQZ gLJLKO58ezR874j1WJOJr9qKxpmAoibM+orTsNdL5ufi/Ys3K6uEvsrAchFb0DMnR8 3us4JwwJt8PCU+WPCvRF/1lCRX/UCPXh/nZ0IL83U6tmzel/JMd7y4mxEWjLYETibG ksqxZBXQSwPKw== Date: Sun, 31 Dec 2023 16:55:54 +9900 Subject: [PATCH 12/17] xfs/449: update test to know about xfs_db -R From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030495.1826350.15828125246602313048.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong The realtime groups feature added a -R flag to xfs_db so that users can pass in the realtime device. Since we've now modified the _scratch_xfs_db to use this facility, we can update the test to do exact comparisons of the xfs_db info command against the mkfs output. Signed-off-by: Darrick J. Wong --- tests/xfs/449 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/xfs/449 b/tests/xfs/449 index 5374bf2f85..66c443e994 100755 --- a/tests/xfs/449 +++ b/tests/xfs/449 @@ -32,7 +32,11 @@ echo DB >> $seqres.full cat $tmp.dbinfo >> $seqres.full # xfs_db doesn't take a rtdev argument, so it reports "realtime=external". # mkfs does, so make a quick substitution -diff -u <(cat $tmp.mkfs | sed -e 's/realtime =\/.*extsz=/realtime =external extsz=/g') $tmp.dbinfo +if $XFS_DB_PROG --help 2>&1 | grep -q -- '-R rtdev'; then + diff -u $tmp.mkfs $tmp.dbinfo +else + diff -u <(cat $tmp.mkfs | sed -e 's/realtime =\/.*extsz=/realtime =external extsz=/g') $tmp.dbinfo +fi _scratch_mount From patchwork Wed Dec 27 13:56:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508517 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C258A4A02; Mon, 1 Jan 2024 00:56:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M8PMkr0h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A7C8C433C8; Mon, 1 Jan 2024 00:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070570; bh=tRMTNM3QfGoz/9U8zJNO0HR24KKcjGIKNThQT91LvIY=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=M8PMkr0hplGzRAzPbQRkHc0qGpCgBhOfYTTCFhKVinrWzOtixiZc6wbkncqix9Ykb TsczOmyFV1fSt3Tb845M6uyPN3o5a3UzvI3Ot4sFysCsRz+1h8WrmOI6UMiXlxz1Fv kH9hn1Sgy5GZSRhZQi6szgukV/8zihjauEAv5bGC+5AiJsRORwDMq75/CnfcpFuKoe OEGcOh3QOO4vzvq6MMJte9viy0VQ6cx6CbQT2z1XKo/23m0LH1htSsM0XCbe+hVNBg Feqz20CvgsTgTl3LkcGyZvnu6wCIrmjQnBo7KGyP4B4fLmN32InGNRLMVmMAZSg2n5 p0+90l2mial+g== Date: Sun, 31 Dec 2023 16:56:09 +9900 Subject: [PATCH 13/17] xfs/122: update for rtbitmap headers From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030508.1826350.16701115460263023294.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Signed-off-by: Darrick J. Wong --- tests/xfs/122.out | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/xfs/122.out b/tests/xfs/122.out index 21b139d838..8bb79ba959 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -119,6 +119,7 @@ sizeof(struct xfs_refcount_key) = 4 sizeof(struct xfs_refcount_rec) = 12 sizeof(struct xfs_rmap_key) = 20 sizeof(struct xfs_rmap_rec) = 24 +sizeof(struct xfs_rtbuf_blkinfo) = 48 sizeof(struct xfs_rtgroup_geometry) = 128 sizeof(struct xfs_rtrmap_key) = 24 sizeof(struct xfs_rtrmap_rec) = 32 From patchwork Wed Dec 27 13:56:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508518 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43C564A02; Mon, 1 Jan 2024 00:56:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iT4Hh7Z7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08468C433C8; Mon, 1 Jan 2024 00:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070586; bh=AEilMhwmNuVwAphEtZ+8Nm71OoXMByvNCvGyNzKbFFs=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=iT4Hh7Z7UZZTxUxlWHsC1Mo0BUz5WA/b7GijUue0W+KYyutqUrbx+9gap2/7B42re eP9FlTRr/OZ5FbL88bU1+GQWqMbNq5VMLxzyFYZAKNCVgU9bseEz2/14794JevNRiy jUMjFitoug1jfqE8HXTBjpQhdczkLdj7YcsTviX/uLisP7eThaQ8B1cy+6/U70um3+ mZPDbnagA5KU5XExbsOapOhRMU9QKcClUqjCffv5bfLkIjLtHpoQ9pqdIGQiMcZe3Q zvk7IVOGc6kVYBXQnwKhO5J4holfvEEAvYCG1kN4C1kTw7H/ae15HNFtpvkd2M/JrN 55Mp++Ko1uWPA== Date: Sun, 31 Dec 2023 16:56:25 +9900 Subject: [PATCH 14/17] xfs/122: udpate test to pick up rtword/suminfo ondisk unions From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030521.1826350.7421441043948772796.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Update this test to check that the ondisk unions for rt bitmap word and rt summary counts are always the correct size. Signed-off-by: Darrick J. Wong --- tests/xfs/122 | 2 +- tests/xfs/122.out | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/xfs/122 b/tests/xfs/122 index ba927c77c4..4e5ba1dfee 100755 --- a/tests/xfs/122 +++ b/tests/xfs/122 @@ -195,7 +195,7 @@ echo 'int main(int argc, char *argv[]) {' >>$cprog # cat /usr/include/xfs/xfs*.h | indent |\ _attribute_filter |\ -grep -E '(} *xfs_.*_t|^struct xfs_[a-z0-9_]*$)' |\ +grep -E '(} *xfs_.*_t|^(union|struct) xfs_[a-z0-9_]*$)' |\ grep -E -v -f $tmp.ignore |\ sed -e 's/^.*}[[:space:]]*//g' -e 's/;.*$//g' -e 's/_t, /_t\n/g' |\ sort | uniq |\ diff --git a/tests/xfs/122.out b/tests/xfs/122.out index 8bb79ba959..6b03b90c2d 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -134,6 +134,8 @@ sizeof(struct xfs_swap_extent) = 64 sizeof(struct xfs_sxd_log_format) = 16 sizeof(struct xfs_sxi_log_format) = 80 sizeof(struct xfs_unmount_log_format) = 8 +sizeof(union xfs_rtword_raw) = 4 +sizeof(union xfs_suminfo_raw) = 4 sizeof(xfs_agf_t) = 224 sizeof(xfs_agfl_t) = 36 sizeof(xfs_agi_t) = 344 From patchwork Wed Dec 27 13:56:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508519 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD7A54A03; Mon, 1 Jan 2024 00:56:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NbKWbi2J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA676C433C7; Mon, 1 Jan 2024 00:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070601; bh=WfURwhsVtITh/bBLPu/AwDwWUwZY5uQNfWGVEh6ML7c=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=NbKWbi2JKMLHU7C61VADUXxYAXtt8A5zCv30suaW8gQjD54bnBoJcb5rsEA4evrP6 JbdQslHkZ4QZr74yxuVD6QYRB7+kUYd+c23mg9HXS8mI04138yLBHe78ckhgcrIrII ya7nr/vdjk4Pdo8sNbj9jZQlo5VhMnvpK/T7YVQukEiFz2FUlcHz8/Btxa9tXfdiBe TLD7D2atB+C3IaIjhQpIqpTrC1LiLm2ovKiHC/P7KhOMoVJvi/5J4VQZUE3+agtT4U mvM5YLpXpHEZ3rERxLlF5STbONVM5/JMtECbCeiLsFzGoJWq1iCoA0OoKDFqg6btTO gUkc08LQzX7aQ== Date: Sun, 31 Dec 2023 16:56:41 +9900 Subject: [PATCH 15/17] xfs/27[46],xfs/556: fix tests to deal with rtgroups output in bmap/fsmap commands From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030534.1826350.7625739026116302245.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Fix these tests to deal with the xfs_io bmap and fsmap commands printing out realtime group numbers if the feature is enabled. Signed-off-by: Darrick J. Wong --- common/xfs | 7 +++++++ tests/xfs/271 | 3 ++- tests/xfs/556 | 16 ++++++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/common/xfs b/common/xfs index e66e11f15d..1136d685e7 100644 --- a/common/xfs +++ b/common/xfs @@ -485,6 +485,13 @@ _xfs_has_feature() feat="rtextents" feat_regex="[1-9][0-9]*" ;; + "rtgroups") + # any fs with rtgroups enabled will have a nonzero rt group + # size, even if there is no rt device (and hence zero actual + # groups) + feat="rgsize" + feat_regex="[1-9][0-9]*" + ;; esac local answer="$($XFS_INFO_PROG "$fs" 2>&1 | grep -E -w -c "$feat=$feat_regex")" diff --git a/tests/xfs/271 b/tests/xfs/271 index d67ac4d6c1..74e2c822c1 100755 --- a/tests/xfs/271 +++ b/tests/xfs/271 @@ -31,6 +31,7 @@ _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount agcount=$(_xfs_mount_agcount $SCRATCH_MNT) +rgcount=$(_xfs_mount_rgcount $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 @@ -48,7 +49,7 @@ cat $TEST_DIR/fsmap >> $seqres.full echo "Check AG header" | tee -a $seqres.full grep 'static fs metadata[[:space:]]*[0-9]*[[:space:]]*(0\.\.' $TEST_DIR/fsmap | tee -a $seqres.full > $TEST_DIR/testout -_within_tolerance "AG header count" $(wc -l < $TEST_DIR/testout) $agcount 0 -v +_within_tolerance "AG header count" $(wc -l < $TEST_DIR/testout) $((agcount + rgcount)) 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 diff --git a/tests/xfs/556 b/tests/xfs/556 index 061d8d5723..5940226223 100755 --- a/tests/xfs/556 +++ b/tests/xfs/556 @@ -47,16 +47,20 @@ victim=$SCRATCH_MNT/a file_blksz=$(_get_file_block_size $SCRATCH_MNT) $XFS_IO_PROG -f -c "pwrite -S 0x58 0 $((4 * file_blksz))" -c "fsync" $victim >> $seqres.full unset errordev -_xfs_is_realtime_file $victim && errordev="RT" + +awk_len_prog='{print $6}' +if _xfs_is_realtime_file $victim; then + if ! _xfs_has_feature $SCRATCH_MNT rtgroups; then + awk_len_prog='{print $4}' + fi + errordev="RT" +fi bmap_str="$($XFS_IO_PROG -c "bmap -elpv" $victim | grep "^[[:space:]]*0:")" echo "$errordev:$bmap_str" >> $seqres.full phys="$(echo "$bmap_str" | $AWK_PROG '{print $3}')" -if [ "$errordev" = "RT" ]; then - len="$(echo "$bmap_str" | $AWK_PROG '{print $4}')" -else - len="$(echo "$bmap_str" | $AWK_PROG '{print $6}')" -fi +len="$(echo "$bmap_str" | $AWK_PROG "$awk_len_prog")" + fs_blksz=$(_get_block_size $SCRATCH_MNT) echo "file_blksz:$file_blksz:fs_blksz:$fs_blksz" >> $seqres.full kernel_sectors_per_fs_block=$((fs_blksz / 512)) From patchwork Wed Dec 27 13:56:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508520 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 807234A02; Mon, 1 Jan 2024 00:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e6bPizjj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5423CC433C7; Mon, 1 Jan 2024 00:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070617; bh=2wKJIeExmBSnGPppMjYqjoK7wyzOeYykRqabK7WifWk=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=e6bPizjj5BaX77lmWqk4SAjxCEGMacJS68RQkVHAsnALPuoLjKBoaSIe/T2iet3wu YfB4inW0wlUqT4HtLuA8wu9lu6p40Agka54ftUJZEsT8hsU71TCegezDTo7u3eVKle O8DRzM30PYTNrrESjVbbvsGPWVdpK66h3LoGYO5yFLlrJeT3kiZwGN5jTUTeiATuBz PDSV8Ta5DWPWzNXZVDppd70v0U16CjV1arP3jMXfbV2j/7Nw+M78k2BbHQ2T/62jrR SxEMMUK6j7pR544al83/9TCprK2FOx0KsxXc0Cn5J/BDoNw4Gtd7Xdlpk0MNf7pc1g PNa8uIadyUWSQ== Date: Sun, 31 Dec 2023 16:56:56 +9900 Subject: [PATCH 16/17] common/xfs: capture realtime devices during metadump/mdrestore From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030547.1826350.12488301162005381994.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong If xfs_metadump supports the -r switch to capture the contents of realtime devices and there is a realtime device, add the option to the command line to enable preservation. Similarly, if xfs_mdrestore supports the -r switch and there's an external scratch rtdev, pass the option so that we can restore rtdev contents. Signed-off-by: Darrick J. Wong --- common/fuzzy | 6 ++++- common/populate | 12 ++++++++-- common/xfs | 65 +++++++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 71 insertions(+), 12 deletions(-) diff --git a/common/fuzzy b/common/fuzzy index b72ee3f67f..d504f0854e 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -309,7 +309,11 @@ __scratch_xfs_fuzz_mdrestore() [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ logdev=$SCRATCH_LOGDEV - _xfs_mdrestore "${POPULATE_METADUMP}" "${SCRATCH_DEV}" "${logdev}" || \ + local rtdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + rtdev=$SCRATCH_RTDEV + + _xfs_mdrestore "${POPULATE_METADUMP}" "${SCRATCH_DEV}" "${logdev}" "${rtdev}" || \ _fail "${POPULATE_METADUMP}: Could not find metadump to restore?" } diff --git a/common/populate b/common/populate index 450b024bfc..dc89eee70e 100644 --- a/common/populate +++ b/common/populate @@ -1017,7 +1017,11 @@ _scratch_populate_restore_cached() { case "${FSTYP}" in "xfs") - _xfs_mdrestore "${metadump}" "${SCRATCH_DEV}" "${logdev}" + local rtdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + rtdev=$SCRATCH_RTDEV + + _xfs_mdrestore "${metadump}" "${SCRATCH_DEV}" "${logdev}" "${rtdev}" return $? ;; "ext2"|"ext3"|"ext4") @@ -1039,8 +1043,12 @@ _scratch_populate_save_metadump() [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ logdev=$SCRATCH_LOGDEV + local rtdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + rtdev=$SCRATCH_RTDEV + _xfs_metadump "$metadump_file" "$SCRATCH_DEV" "$logdev" \ - compress + "$rtdev" compress res=$? ;; "ext2"|"ext3"|"ext4") diff --git a/common/xfs b/common/xfs index 1136d685e7..1ff81f4cc2 100644 --- a/common/xfs +++ b/common/xfs @@ -681,11 +681,17 @@ _xfs_metadump() { local metadump="$1" local device="$2" local logdev="$3" - local compressopt="$4" - shift; shift; shift; shift + local rtdev="$4" + local compressopt="$5" + shift; shift; shift; shift; shift local options="$@" test -z "$options" && options="-a -o" local metadump_has_dash_x + local metadump_has_dash_r + + # Does metadump support capturing realtime devices? + $XFS_METADUMP_PROG --help 2>&1 | grep -q -- '-r rtdev' && \ + metadump_has_dash_r=1 # Use metadump v2 format unless the user gave us a specific version $XFS_METADUMP_PROG --help 2>&1 | grep -q -- '-v version' && \ @@ -699,6 +705,10 @@ _xfs_metadump() { options="$options -l $logdev" fi + if [ "$rtdev" != "none" ] && [ -n "$metadump_has_dash_r" ]; then + options="$options -r $rtdev" + fi + $XFS_METADUMP_PROG $options "$device" "$metadump" res=$? [ "$compressopt" = "compress" ] && [ -n "$DUMP_COMPRESSOR" ] && @@ -710,14 +720,19 @@ _xfs_mdrestore() { local metadump="$1" local device="$2" local logdev="$3" - shift; shift; shift + local rtdev="$4" + shift; shift; shift; shift local options="$@" local need_repair local mdrestore_has_dash_l + local mdrestore_has_dash_r # Does mdrestore support restoring to external devices? $XFS_MDRESTORE_PROG --help 2>&1 | grep -q -- '-l logdev' && mdrestore_has_dash_l=1 + # Does mdrestore support restoring to realtime devices? + $XFS_MDRESTORE_PROG --help 2>&1 | grep -q -- '-r rtdev' && + mdrestore_has_dash_r=1 # If we're configured for compressed dumps and there isn't already an # uncompressed dump, see if we can use DUMP_COMPRESSOR to decompress @@ -743,6 +758,20 @@ _xfs_mdrestore() { $XFS_IO_PROG -d -c 'pwrite -S 0 -q 0 1m' "$logdev" fi + if [ "$rtdev" != "none" ]; then + # We have a realtime device. If mdrestore supports restoring + # to it, configure ourselves to do that. + if [ -n "$mdrestore_has_dash_r" ]; then + options="$options -r $rtdev" + fi + + # Wipe the realtime device. If mdrestore doesn't support + # restoring to realtime devices or the metadump file doesn't + # capture the realtime group headers, this is our only chance + # to signal that the log header needs to be rewritten. + $XFS_IO_PROG -d -c 'pwrite -S 0 -q 0 1m' "$rtdev" + fi + $XFS_MDRESTORE_PROG $options "${metadump}" "${device}" res=$? test $res -ne 0 && return $res @@ -757,6 +786,16 @@ _xfs_mdrestore() { fi fi + # If there's a realtime device, check to see if the restore rewrote the + # rt group headers. If not, we need to run xfs_repair to format new + # group headers onto the realtime device. + if [ "$rtdev" != "none" ] && [ -z "$need_repair" ]; then + magic="$($XFS_IO_PROG -c 'pread -q -v 0 4' "$rtdev")" + if [ "$magic" = "00000000: 00 00 00 00 ...." ]; then + need_repair=1 + fi + fi + test -z "$need_repair" && return 0 echo "repairing fs to fix uncaptured parts of fs." >> $seqres.full @@ -768,12 +807,16 @@ _scratch_xfs_metadump() { local metadump=$1 shift + local logdev=none - [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ logdev=$SCRATCH_LOGDEV - _xfs_metadump "$metadump" "$SCRATCH_DEV" "$logdev" nocompress "$@" + local rtdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + rtdev=$SCRATCH_RTDEV + + _xfs_metadump "$metadump" "$SCRATCH_DEV" "$logdev" "$rtdev" nocompress "$@" } # Restore snapshotted metadata on the scratch device @@ -786,7 +829,11 @@ _scratch_xfs_mdrestore() [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ logdev=$SCRATCH_LOGDEV - _xfs_mdrestore "$metadump" "$SCRATCH_DEV" "$logdev" "$@" + local rtdev=none + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + rtdev=$SCRATCH_RTDEV + + _xfs_mdrestore "$metadump" "$SCRATCH_DEV" "$logdev" "$rtdev" "$@" } # Do not use xfs_repair (offline fsck) to rebuild the filesystem @@ -923,7 +970,7 @@ _check_xfs_filesystem() if [ "$ok" -ne 1 ] && [ "$DUMP_CORRUPT_FS" = "1" ]; then local flatdev="$(basename "$device")" _xfs_metadump "$seqres.$flatdev.check.md" "$device" "$logdev" \ - compress >> $seqres.full + "$rtdev" compress >> $seqres.full fi # Optionally test the index rebuilding behavior. @@ -956,7 +1003,7 @@ _check_xfs_filesystem() if [ "$rebuild_ok" -ne 1 ] && [ "$DUMP_CORRUPT_FS" = "1" ]; then local flatdev="$(basename "$device")" _xfs_metadump "$seqres.$flatdev.rebuild.md" "$device" \ - "$logdev" compress >> $seqres.full + "$logdev" "$rtdev" compress >> $seqres.full fi fi @@ -1040,7 +1087,7 @@ _check_xfs_filesystem() if [ "$orebuild_ok" -ne 1 ] && [ "$DUMP_CORRUPT_FS" = "1" ]; then local flatdev="$(basename "$device")" _xfs_metadump "$seqres.$flatdev.orebuild.md" "$device" \ - "$logdev" compress >> $seqres.full + "$logdev" "$rtdev" compress >> $seqres.full fi fi From patchwork Wed Dec 27 13:57:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13508521 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A2C44A04; Mon, 1 Jan 2024 00:57:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DzqCBzqq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFF05C433C8; Mon, 1 Jan 2024 00:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704070633; bh=XaVndy1OPIO5w1cmb6PN1D/P8heGFWib/A35S5NaWFU=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=DzqCBzqqm6LhEG96o3hATWEXe6P9nAICBHtfy6vPZO7cbOObuI5CUj/aOEprULJH0 X7lsltnxu9F3Pk4wtCohDZOFpzPCIIo6PXdiCkIEp9tDzGMYzocyy8vUBEWpARNY0d cg9wKiE+Dfhk/ZMkRcEf5+Hpts3Pc6TeboRhGbs+6ijYD/bZCyN95b4dGN8RcuXaJF 0WLmyPNuxmS+cI6/Ee6YddL+ulxRk6Tv2yNtRTiX4MzzWEwY339BOuhWulshJVf1cr FLXXvY2huHqIRCacv1BOSKIuJenVWLG5sVSkICESi3jjU2dH7//NMZxJ8/gUqVXXyV 4tvCu4De1xxZg== Date: Sun, 31 Dec 2023 16:57:12 +9900 Subject: [PATCH 17/17] common/fuzzy: adapt the scrub stress tests to support rtgroups From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <170405030561.1826350.9873455298200379629.stgit@frogsfrogsfrogs> In-Reply-To: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> References: <170405030327.1826350.709349465573559319.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Adapt the scrub stress testing framework to support checking realtime group metadata. Signed-off-by: Darrick J. Wong --- common/fuzzy | 27 ++++++++++++++++++++++----- common/xfs | 9 +++++++++ tests/xfs/581 | 2 +- tests/xfs/720 | 2 +- tests/xfs/795 | 2 +- 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/common/fuzzy b/common/fuzzy index d504f0854e..2de06622e5 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -847,8 +847,10 @@ __stress_one_scrub_loop() { local scrub_tgt="$3" local scrub_startat="$4" local start_agno="$5" - shift; shift; shift; shift; shift + local start_rgno="$6" + shift; shift; shift; shift; shift; shift local agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" + local rgcount="$(_xfs_mount_rgcount $SCRATCH_MNT)" local xfs_io_args=() for arg in "$@"; do @@ -861,6 +863,12 @@ __stress_one_scrub_loop() { local ag_arg="$(echo "$arg" | sed -e "s|%agno%|$agno|g")" xfs_io_args+=('-c' "$ag_arg") done + elif echo "$arg" | grep -q -w '%rgno%'; then + # Substitute the rtgroup number + for ((rgno = start_rgno; rgno < rgcount; rgno++)); do + local rg_arg="$(echo "$arg" | sed -e "s|%rgno%|$rgno|g")" + xfs_io_args+=('-c' "$rg_arg") + done else xfs_io_args+=('-c' "$arg") fi @@ -1245,7 +1253,9 @@ _scratch_xfs_stress_scrub_cleanup() { __stress_scrub_check_commands() { local scrub_tgt="$1" local start_agno="$2" - shift; shift + local start_rgno="$3" + shift; shift; shift + local rgcount="$(_xfs_mount_rgcount $SCRATCH_MNT)" local cooked_tgt="$scrub_tgt" case "$scrub_tgt" in @@ -1275,6 +1285,10 @@ __stress_scrub_check_commands() { cooked_arg="$(echo "$cooked_arg" | sed -e 's/^repair/repair -R/g')" fi cooked_arg="$(echo "$cooked_arg" | sed -e "s/%agno%/$start_agno/g")" + if echo "$cooked_arg" | grep -q -w '%rgno%'; then + test "$rgcount" -eq 0 && continue + cooked_arg="$(echo "$cooked_arg" | sed -e "s/%rgno%/$start_rgno/g")" + fi testio=`$XFS_IO_PROG -x -c "$cooked_arg" "$cooked_tgt" 2>&1` echo $testio | grep -q "Unknown type" && \ _notrun "xfs_io scrub subcommand support is missing" @@ -1300,6 +1314,7 @@ __stress_scrub_check_commands() { # in a separate loop. If zero -i options are specified, do not run. # Callers must check each of these commands (via _require_xfs_io_command) # before calling here. +# -R For %rgno% substitution, start with this rtgroup instead of rtgroup 0. # -r Run fsstress for this amount of time, then remount the fs ro or rw. # The default is to run fsstress continuously with no remount, unless # XFS_SCRUB_STRESS_REMOUNT_PERIOD is set. @@ -1346,6 +1361,7 @@ _scratch_xfs_stress_scrub() { local remount_period="${XFS_SCRUB_STRESS_REMOUNT_PERIOD}" local stress_tgt="${XFS_SCRUB_STRESS_TARGET:-default}" local start_agno=0 + local start_rgno=0 __SCRUB_STRESS_FREEZE_PID="" __SCRUB_STRESS_REMOUNT_LOOP="" @@ -1353,12 +1369,13 @@ _scratch_xfs_stress_scrub() { touch "$runningfile" OPTIND=1 - while getopts "a:fi:r:s:S:t:w:x:X:" c; do + while getopts "a:fi:r:R:s:S:t:w:x:X:" c; do case "$c" in a) start_agno="$OPTARG";; f) freeze=yes;; i) io_args+=("$OPTARG");; r) remount_period="$OPTARG";; + R) start_rgno="$OPTARG";; s) one_scrub_args+=("$OPTARG");; S) xfs_scrub_args+=("$OPTARG");; t) scrub_tgt="$OPTARG";; @@ -1369,7 +1386,7 @@ _scratch_xfs_stress_scrub() { esac done - __stress_scrub_check_commands "$scrub_tgt" "$start_agno" \ + __stress_scrub_check_commands "$scrub_tgt" "$start_agno" "$start_rgno" \ "${one_scrub_args[@]}" if ! command -v "__stress_scrub_${exerciser}_loop" &>/dev/null; then @@ -1425,7 +1442,7 @@ _scratch_xfs_stress_scrub() { if [ "${#one_scrub_args[@]}" -gt 0 ]; then __stress_one_scrub_loop "$end" "$runningfile" "$scrub_tgt" \ - "$scrub_startat" "$start_agno" \ + "$scrub_startat" "$start_agno" "$start_rgno" \ "${one_scrub_args[@]}" & fi diff --git a/common/xfs b/common/xfs index 1ff81f4cc2..313b7045bd 100644 --- a/common/xfs +++ b/common/xfs @@ -1584,6 +1584,15 @@ _xfs_mount_agcount() $XFS_INFO_PROG "$1" | sed -n "s/^.*agcount=\([[:digit:]]*\).*/\1/p" } +# Find rtgroup count of mounted filesystem +_xfs_mount_rgcount() +{ + local rtgroups="$($XFS_INFO_PROG "$1" | grep rgcount= | sed -e 's/^.*rgcount=\([0-9]*\).*$/\1/g')" + + test -z "$rtgroups" && rtgroups=0 + echo "$rtgroups" +} + # Wipe the superblock of each XFS AGs _try_wipe_scratch_xfs() { diff --git a/tests/xfs/581 b/tests/xfs/581 index 1d08bc7df3..353421130e 100755 --- a/tests/xfs/581 +++ b/tests/xfs/581 @@ -32,7 +32,7 @@ _require_xfs_stress_scrub _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount _require_xfs_has_feature "$SCRATCH_MNT" realtime -_scratch_xfs_stress_scrub -s "scrub rtbitmap" +_scratch_xfs_stress_scrub -s "scrub rtbitmap" -s "scrub rgbitmap %rgno%" # success, all done echo Silence is golden diff --git a/tests/xfs/720 b/tests/xfs/720 index 2b6406da6e..3242a19b02 100755 --- a/tests/xfs/720 +++ b/tests/xfs/720 @@ -39,7 +39,7 @@ alloc_unit=$(_get_file_block_size $SCRATCH_MNT) scratchfile=$SCRATCH_MNT/file touch $scratchfile $XFS_IO_PROG -x -c 'inject force_repair' $SCRATCH_MNT -__stress_scrub_check_commands "$scratchfile" "" 'repair bmapbtd' +__stress_scrub_check_commands "$scratchfile" "" "" 'repair bmapbtd' # Compute the number of extent records needed to guarantee btree format, # assuming 16 bytes for each ondisk extent record diff --git a/tests/xfs/795 b/tests/xfs/795 index a381db320f..2ce2ec5365 100755 --- a/tests/xfs/795 +++ b/tests/xfs/795 @@ -39,7 +39,7 @@ scratchfile=$SCRATCH_MNT/file mkdir $scratchdir touch $scratchfile $XFS_IO_PROG -x -c 'inject force_repair' $SCRATCH_MNT -__stress_scrub_check_commands "$scratchdir" "" 'repair directory' +__stress_scrub_check_commands "$scratchdir" "" "" 'repair directory' # Create a 2-dirblock directory total_size=$((alloc_unit * 2))