From patchwork Fri Dec 30 22:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13085197 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 5B39EC4332F for ; Sat, 31 Dec 2022 00:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235679AbiLaAlT (ORCPT ); Fri, 30 Dec 2022 19:41:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235671AbiLaAlS (ORCPT ); Fri, 30 Dec 2022 19:41:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E97541D0C8; Fri, 30 Dec 2022 16:41:17 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8461D61D52; Sat, 31 Dec 2022 00:41:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB737C433EF; Sat, 31 Dec 2022 00:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672447276; bh=yLjJKAEJUiu3N1MjaYqZHEqzaeNJVvJT7ZO3+YlYZTI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=jhbUcWGTPa+naUSFBHtE15Z5S+sDTQtzJva0iwUvNI+SYbFH2053XKuzWBTeFejaK PPJpHxox7KhW8wQzeeSpM5nTAZ6c7Olo/OT4FI4j+6oQ9ZlSv/HuI/PKcH6ZJZr2MZ 7yVxvEBGvCvyCZ1xQdW6vVnwiVBaJbTO7CaBxvwkkOEZci88viVaK8HfQycBMj36su 3KvMqNF0Yhr2tS+/qcl8OS9/rPams8RVavdI8RIHJip2q6l1kV2W5wKUWlqtkKSVOV nE+cnGV/dEeL4hfdan/vWVAVSLDNVxzMJKEX+AxngFJvAfHeG7ZgxZSzv138KnJuqo NR8my0nZ0DEbw== Subject: [PATCH 1/4] xfs: test rebuilding xattrs when the data fork is btree format From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Fri, 30 Dec 2022 14:19:18 -0800 Message-ID: <167243875848.725760.14160153508359415137.stgit@magnolia> In-Reply-To: <167243875835.725760.8458608166534095780.stgit@magnolia> References: <167243875835.725760.8458608166534095780.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Make sure we handle the case of rebuilding extended attributes properly when the data fork is in btree format and we therefore cannot zap the attr fork. Signed-off-by: Darrick J. Wong --- tests/xfs/746 | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/746.out | 2 + 2 files changed, 87 insertions(+) create mode 100755 tests/xfs/746 create mode 100644 tests/xfs/746.out diff --git a/tests/xfs/746 b/tests/xfs/746 new file mode 100755 index 0000000000..5853259e84 --- /dev/null +++ b/tests/xfs/746 @@ -0,0 +1,85 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test No. 746 +# +# Make sure online repair can handle rebuilding xattrs when the data fork is +# in btree format and we cannot just zap the attr fork. + +. ./common/preamble +_begin_fstest auto quick online_repair + +# Override the default cleanup function. +_cleanup() +{ + cd / +} + +# Import common functions. +. ./common/inject +. ./common/filter + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_xfs_io_error_injection "force_repair" +_require_xfs_io_command "falloc" +_require_xfs_io_command "repair" +_require_test_program "punch-alternating" + +_scratch_mkfs > $tmp.mkfs +_scratch_mount + +_supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || _notrun "Scrub not supported" + +# Force data device extents so that we can create a file with the exact bmbt +# that we need regardless of rt configuration. +_xfs_force_bdev data $SCRATCH_MNT + +file=$SCRATCH_MNT/moofile +touch $file + +# Create some xattrs so that we have to rebuild them. +$XFS_IO_PROG -f -c 'pwrite -S 0x58 0 76' $file.txt >> $seqres.full +$SETFATTR_PROG -n user.SGI_BCL_FILE -v "$(cat $file.txt)" $file + +$SETFATTR_PROG -n user.crtime_usec -v 12345678 $file + +blksz=$(_get_file_block_size $SCRATCH_MNT) +ino=$(stat -c '%i' $file) + +# Figure out how many extents we need to have to create a data fork that's in +# btree format. +umount $SCRATCH_MNT +di_forkoff=$(_scratch_xfs_db -c "inode $ino" -c "p core.forkoff" | \ + awk '{print $3}') +_scratch_xfs_db -c "inode $ino" -c "p" >> $seqres.full +_scratch_mount + +# Create a data fork in btree format +min_ext_for_btree=$((di_forkoff * 8 / 16)) +$XFS_IO_PROG -c "falloc 0 $(( (min_ext_for_btree + 1) * 2 * blksz))" $file +$here/src/punch-alternating $file + +# Make sure the data fork is in btree format. +umount $SCRATCH_MNT +_scratch_xfs_db -c "inode $ino" -c "p core.format" | grep -q "btree" || \ + echo "data fork not in btree format?" +echo "about to start test" >> $seqres.full +_scratch_xfs_db -c "inode $ino" -c "p" >> $seqres.full +_scratch_mount + +# Force repair the xattr fork +_scratch_inject_error force_repair +$XFS_IO_PROG -x -c 'repair xattr' $file 2>&1 | tee $tmp.repair.log +grep -q 'Operation not supported' $tmp.repair.log && \ + _notrun "online xattr repair not supported" + +# If online repair did it correctly, the filesystem won't be corrupt. Let the +# post-test check do its thing. + +# success, all done +echo "Silence is golden." +status=0 +exit diff --git a/tests/xfs/746.out b/tests/xfs/746.out new file mode 100644 index 0000000000..365485b0b3 --- /dev/null +++ b/tests/xfs/746.out @@ -0,0 +1,2 @@ +QA output created by 746 +Silence is golden. From patchwork Fri Dec 30 22:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13085198 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 B78DAC3DA7C for ; Sat, 31 Dec 2022 00:41:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235671AbiLaAlg (ORCPT ); Fri, 30 Dec 2022 19:41:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235615AbiLaAle (ORCPT ); Fri, 30 Dec 2022 19:41:34 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F5741DDE5; Fri, 30 Dec 2022 16:41:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0A18161D52; Sat, 31 Dec 2022 00:41:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63297C433EF; Sat, 31 Dec 2022 00:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672447292; bh=YsDWovGILNhQa7ey8AJBVGDOT6YYQ52UjuMRQCEqMgg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=t+JwrUaLGz0w0aPo5jhcLI/ZwSkNJXledZjengkvcFJjAMdXWTMZKFKMx7nJ7KBMf TXcaEWu2Sw61KM9auVS+oDsHoGkwab4PmkGgdeVXtGECokTDfyOTIk37E2I18O9MXs tPMzzr9aD6pmkD9ydGpkH7PMiTt2jYDSOCuV0X3mmCBdzQgNzZYqw5U5+qz+lMLa9E Oy+LMW6a7PFbcMTgaAsLcDTKtohiXzjzWeu3tMUMIbB9Vo0UPqhxEGl8y1vvYp72bp Vx1WSo2IzaohhlS84HXcYqEP631qtZNRnTxClWM4jvRWv2Gz6193F3AfmngrJ87R2X zmchij8fqZuvA== Subject: [PATCH 2/4] xfs: race fsstress with online repair for inode and fork metadata From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Fri, 30 Dec 2022 14:19:18 -0800 Message-ID: <167243875862.725760.4136098626843388017.stgit@magnolia> In-Reply-To: <167243875835.725760.8458608166534095780.stgit@magnolia> References: <167243875835.725760.8458608166534095780.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong For each XFS_SCRUB_TYPE_* that looks at inode and data/attr/cow fork metadata, create a test that runs that repairer in the foreground and fsstress in the background. Signed-off-by: Darrick J. Wong --- tests/xfs/807 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/807.out | 2 ++ tests/xfs/808 | 39 +++++++++++++++++++++++++++++++++++++++ tests/xfs/808.out | 2 ++ tests/xfs/846 | 39 +++++++++++++++++++++++++++++++++++++++ tests/xfs/846.out | 2 ++ 6 files changed, 121 insertions(+) create mode 100755 tests/xfs/807 create mode 100644 tests/xfs/807.out create mode 100755 tests/xfs/808 create mode 100644 tests/xfs/808.out create mode 100755 tests/xfs/846 create mode 100644 tests/xfs/846.out diff --git a/tests/xfs/807 b/tests/xfs/807 new file mode 100755 index 0000000000..e32a37057d --- /dev/null +++ b/tests/xfs/807 @@ -0,0 +1,37 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. Inc. All Rights Reserved. +# +# FS QA Test No. 807 +# +# Race fsstress and data fork repair for a while to see if we crash or livelock. +# +. ./common/preamble +_begin_fstest online_repair dangerous_fsstress_repair + +_cleanup() { + _scratch_xfs_stress_scrub_cleanup &> /dev/null + cd / + rm -r -f $tmp.* +} +_register_cleanup "_cleanup" BUS + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./common/inject +. ./common/xfs + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_xfs_stress_online_repair + +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount +_scratch_xfs_stress_online_repair -s "repair bmapbtd" -t "%datafile%" + +# success, all done +echo Silence is golden +status=0 +exit diff --git a/tests/xfs/807.out b/tests/xfs/807.out new file mode 100644 index 0000000000..3752a5f715 --- /dev/null +++ b/tests/xfs/807.out @@ -0,0 +1,2 @@ +QA output created by 807 +Silence is golden diff --git a/tests/xfs/808 b/tests/xfs/808 new file mode 100755 index 0000000000..378b606427 --- /dev/null +++ b/tests/xfs/808 @@ -0,0 +1,39 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. Inc. All Rights Reserved. +# +# FS QA Test No. 808 +# +# Race fsstress and attr fork repair for a while to see if we crash or livelock. +# +. ./common/preamble +_begin_fstest online_repair dangerous_fsstress_repair + +_cleanup() { + _scratch_xfs_stress_scrub_cleanup &> /dev/null + cd / + rm -r -f $tmp.* +} +_register_cleanup "_cleanup" BUS + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./common/inject +. ./common/xfs +. ./common/attr + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_attrs +_require_xfs_stress_online_repair + +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount +_scratch_xfs_stress_online_repair -x 'xattr' -s "repair bmapbta" -t "%attrfile%" + +# success, all done +echo Silence is golden +status=0 +exit diff --git a/tests/xfs/808.out b/tests/xfs/808.out new file mode 100644 index 0000000000..8825342849 --- /dev/null +++ b/tests/xfs/808.out @@ -0,0 +1,2 @@ +QA output created by 808 +Silence is golden diff --git a/tests/xfs/846 b/tests/xfs/846 new file mode 100755 index 0000000000..8388a22730 --- /dev/null +++ b/tests/xfs/846 @@ -0,0 +1,39 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. Inc. All Rights Reserved. +# +# FS QA Test No. 846 +# +# Race fsstress and CoW fork repair for a while to see if we crash or livelock. +# +. ./common/preamble +_begin_fstest online_repair dangerous_fsstress_repair + +_cleanup() { + _scratch_xfs_stress_scrub_cleanup &> /dev/null + cd / + rm -r -f $tmp.* +} +_register_cleanup "_cleanup" BUS + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./common/inject +. ./common/xfs +. ./common/reflink + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_xfs_stress_online_repair + +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount +_require_xfs_has_feature "$SCRATCH_MNT" reflink +_scratch_xfs_stress_online_repair -s "repair bmapbtc" -t "%cowfile%" + +# success, all done +echo Silence is golden +status=0 +exit diff --git a/tests/xfs/846.out b/tests/xfs/846.out new file mode 100644 index 0000000000..c88a3035c3 --- /dev/null +++ b/tests/xfs/846.out @@ -0,0 +1,2 @@ +QA output created by 846 +Silence is golden From patchwork Fri Dec 30 22:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13085199 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 2A30DC4332F for ; Sat, 31 Dec 2022 00:42:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235872AbiLaAl7 (ORCPT ); Fri, 30 Dec 2022 19:41:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235615AbiLaAlw (ORCPT ); Fri, 30 Dec 2022 19:41:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F10C1D0C8; Fri, 30 Dec 2022 16:41:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 32333B81E5C; Sat, 31 Dec 2022 00:41:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E594FC433D2; Sat, 31 Dec 2022 00:41:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672447308; bh=P2W3QZG1FHvcjrs1obLySrww9Z+qQqFuBjXBZallNe0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=IbN2jh8FOsf82xxc52IXzIKXtvaI1YhAGCxjc91rRzMseMxDVspJwhPBW8Lub2zJE 5g5FD4x7mlcZMjfs2Fw1XgdHSY+Po124bpLQ/VtYNtFcW5bWXgbz1c8bJz23iKKD7c aatA8v7n+MUpzdDrtL98iDH/ygvbFf4SFIC2HL6d7vboU2IY6+8Q6WQXwaC1w/f5Pt a4ACB454nRIpCTcpWleYqDFxw672tx9hKseFwjIetPo2aWKRrv2Lo1t4wNl6TP0L5A r7wWfk0p44ECkOrpsRDsbWv9wD3qbeBbdWbrJQLV/k40YSv6rgHC0RoFJy8x/v4jc4 +yYg6HY9cvYIQ== Subject: [PATCH 3/4] xfs: ensure that online file data fork repairs don't hit EDQUOT From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Fri, 30 Dec 2022 14:19:18 -0800 Message-ID: <167243875875.725760.15413971718682420180.stgit@magnolia> In-Reply-To: <167243875835.725760.8458608166534095780.stgit@magnolia> References: <167243875835.725760.8458608166534095780.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Add a test to ensure that the sysadmin doesn't get EDQUOT if they try to repair file data fork metadata when we've already exceeded a quota limit somewhere. Signed-off-by: Darrick J. Wong --- tests/xfs/840 | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/840.out | 3 ++ 2 files changed, 75 insertions(+) create mode 100755 tests/xfs/840 create mode 100644 tests/xfs/840.out diff --git a/tests/xfs/840 b/tests/xfs/840 new file mode 100755 index 0000000000..fff41c5b8a --- /dev/null +++ b/tests/xfs/840 @@ -0,0 +1,72 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test 840 +# +# Ensure that the sysadmin won't hit EDQUOT while repairing file data forks +# even if the file's quota limits have been exceeded. This tests the quota +# reservation handling inside the bmap btree rebuilding code. +# +. ./common/preamble +_begin_fstest online_repair + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./common/inject +. ./common/quota + +# real QA test starts here + +# Modify as appropriate. +_supported_fs xfs +_require_xfs_io_command "falloc" +_require_quota +_require_user +_require_test_program "punch-alternating" +_require_scratch +_require_xfs_stress_online_repair + +_scratch_mkfs > "$seqres.full" 2>&1 +_qmount_option usrquota +_qmount + +blocksize=$(_get_block_size $SCRATCH_MNT) +alloc_unit=$(_get_file_block_size $SCRATCH_MNT) + +# Make sure we can actually repair a data fork +scratchfile=$SCRATCH_MNT/file +touch $scratchfile +$XFS_IO_PROG -x -c 'inject force_repair' $SCRATCH_MNT +__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 +bmbt_records=$(( (blocksize / 16) * 5 / 4 )) +total_size=$(( bmbt_records * 2 * alloc_unit )) + +# Create a file with a data fork in bmap btree format +$XFS_IO_PROG -c "falloc 0 $total_size" $scratchfile >> $seqres.full +$here/src/punch-alternating $scratchfile + +# Set a low quota hardlimit for an unprivileged uid and chown the file to it +echo "set up quota" >> $seqres.full +$XFS_QUOTA_PROG -x -c "limit -u bhard=$((alloc_unit * 2)) $qa_user" $SCRATCH_MNT +chown $qa_user $scratchfile +$XFS_QUOTA_PROG -x -c 'report -u' $SCRATCH_MNT >> $seqres.full + +# Rebuild the data fork +echo "repairs" >> $seqres.full +$XFS_IO_PROG -x -c 'inject force_repair' -c 'repair bmapbtd' $scratchfile +$XFS_QUOTA_PROG -x -c 'report -u' $SCRATCH_MNT >> $seqres.full + +# Fail at appending the file as qa_user to ensure quota enforcement works +echo "fail quota" >> $seqres.full +su - "$qa_user" -c "$XFS_IO_PROG -c 'pwrite 10g 1' $scratchfile" >> $seqres.full +$XFS_QUOTA_PROG -x -c 'report -u' $SCRATCH_MNT >> $seqres.full + +# success, all done +echo Silence is golden +status=0 +exit diff --git a/tests/xfs/840.out b/tests/xfs/840.out new file mode 100644 index 0000000000..8c32ec12bb --- /dev/null +++ b/tests/xfs/840.out @@ -0,0 +1,3 @@ +QA output created by 840 +pwrite: Disk quota exceeded +Silence is golden From patchwork Fri Dec 30 22:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13085200 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 AECE6C4332F for ; Sat, 31 Dec 2022 00:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235797AbiLaAmF (ORCPT ); Fri, 30 Dec 2022 19:42:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235615AbiLaAmF (ORCPT ); Fri, 30 Dec 2022 19:42:05 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B1C1D0C8; Fri, 30 Dec 2022 16:42:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1D45A61D2E; Sat, 31 Dec 2022 00:42:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76C74C433D2; Sat, 31 Dec 2022 00:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672447323; bh=EmJFQ1pIFYqKMImC+T+GP+rzsEqbIs+a9RBIy0lpza4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=kz3Qq0yBs2tEcRHKbTJOOd1K0tM0sPqQIk+kpRBXPx9sYWHecKbbCDIJup/jSA1EP DctNQnPRAcrGQ/3Bc/JzlKgHxZXq0TYjfCwaVtjk2SNzmm1/us4ifwclVZF8gBPhxR NhiZAXx6Q3LXGUZtgah6/gsw8/ydM6dxvE1ZkGp1aly9Nd0pnccyaaxFimLzVM11zE 2KH/UZurNYp8BP4T7JKG8r2D1udVpc8kEX7UPMf6L3CAFHQ8z4oWuBe/vRFDG9Zs6r MbJ3ylLakryJVBraVB6IfJrC8MAOZwaZVl020Pld+G/ZI7yXRWogNQ2xZ5E/lL+SqD nxvp5m303hkjA== Subject: [PATCH 4/4] xfs: race fsstress with online repair for special file metadata From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Fri, 30 Dec 2022 14:19:18 -0800 Message-ID: <167243875889.725760.16841240655943822802.stgit@magnolia> In-Reply-To: <167243875835.725760.8458608166534095780.stgit@magnolia> References: <167243875835.725760.8458608166534095780.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong For each XFS_SCRUB_TYPE_* that looks at symbolic link and special file metadata, create a test that runs that repairer in the foreground and fsstress in the background. Signed-off-by: Darrick J. Wong --- tests/xfs/828 | 38 ++++++++++++++++++++++++++++++++++++++ tests/xfs/828.out | 2 ++ tests/xfs/829 | 39 +++++++++++++++++++++++++++++++++++++++ tests/xfs/829.out | 2 ++ 4 files changed, 81 insertions(+) create mode 100755 tests/xfs/828 create mode 100644 tests/xfs/828.out create mode 100755 tests/xfs/829 create mode 100644 tests/xfs/829.out diff --git a/tests/xfs/828 b/tests/xfs/828 new file mode 100755 index 0000000000..99020e9b3c --- /dev/null +++ b/tests/xfs/828 @@ -0,0 +1,38 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. Inc. All Rights Reserved. +# +# FS QA Test No. 828 +# +# Race fsstress and symlink repair for a while to see if we crash or livelock. +# We can't open special files directly for scrubbing, so we use xfs_scrub(8). +# +. ./common/preamble +_begin_fstest online_repair dangerous_fsstress_repair + +_cleanup() { + _scratch_xfs_stress_scrub_cleanup &> /dev/null + cd / + rm -r -f $tmp.* +} +_register_cleanup "_cleanup" BUS + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./common/inject +. ./common/xfs + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_xfs_stress_online_repair + +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount +XFS_SCRUB_PHASE=3 _scratch_xfs_stress_online_repair -x 'symlink' -S '-k' + +# success, all done +echo Silence is golden +status=0 +exit diff --git a/tests/xfs/828.out b/tests/xfs/828.out new file mode 100644 index 0000000000..d0291290a9 --- /dev/null +++ b/tests/xfs/828.out @@ -0,0 +1,2 @@ +QA output created by 828 +Silence is golden diff --git a/tests/xfs/829 b/tests/xfs/829 new file mode 100755 index 0000000000..7451f66069 --- /dev/null +++ b/tests/xfs/829 @@ -0,0 +1,39 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. Inc. All Rights Reserved. +# +# FS QA Test No. 827 +# +# Race fsstress and special file repair for a while to see if we crash or +# livelock. We can't open special files directly for scrubbing, so we use +# xfs_scrub(8). +# +. ./common/preamble +_begin_fstest online_repair dangerous_fsstress_repair + +_cleanup() { + _scratch_xfs_stress_scrub_cleanup &> /dev/null + cd / + rm -r -f $tmp.* +} +_register_cleanup "_cleanup" BUS + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./common/inject +. ./common/xfs + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_xfs_stress_online_repair + +_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mount +XFS_SCRUB_PHASE=3 _scratch_xfs_stress_online_repair -x 'mknod' -S '-k' + +# success, all done +echo Silence is golden +status=0 +exit diff --git a/tests/xfs/829.out b/tests/xfs/829.out new file mode 100644 index 0000000000..8a43a15204 --- /dev/null +++ b/tests/xfs/829.out @@ -0,0 +1,2 @@ +QA output created by 829 +Silence is golden