From patchwork Mon Jul 3 17:03: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: 13300291 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 9DB5BC001B0 for ; Mon, 3 Jul 2023 17:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbjGCRDm (ORCPT ); Mon, 3 Jul 2023 13:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjGCRDl (ORCPT ); Mon, 3 Jul 2023 13:03:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B533E59; Mon, 3 Jul 2023 10:03:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CBB9C60FED; Mon, 3 Jul 2023 17:03:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3118CC433C8; Mon, 3 Jul 2023 17:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688403819; bh=nCuTXmKzLMOvOmtyUPDQWvZxLJF+L2sZ+Ks7LgXGHpE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=lqbdVfmSkPNQw4F9dvFwMMPIJOtYQSpcCPhPTi8BFZLoD/tO+ymxPZKyXdB8Hkmr7 RRN2xD+yBbWhTxpTMaVhBQuhNHMM1lkm9nHdZeRH8i4Q/yOtwVv5tGd97RunbMEim4 6crcJPBin+GLbxBCB7zGhN45nS9EhKoinutS8XrHaA2l5Z5tS4VP4PD4PYkClrK0IK yLgLviF8E4RaYonVrEwMWTkpXf0A0OzR/RKny1srQUvOybbmwPMxOdaSTDlWjjFTHR S4c/mv4NJXuro4RggVvVuopnG2HsuJa5kWe131TdCJtvOHzUxQblJ9W9phjL/DK0Uv 61TiaqSkZZQ+w== Subject: [PATCH 1/5] xfs/529: fix bogus failure when realtime is configured 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: Mon, 03 Jul 2023 10:03:38 -0700 Message-ID: <168840381873.1317961.17241883212352752910.stgit@frogsfrogsfrogs> In-Reply-To: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> References: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong If I have a realtime volume configured, this test will sometimes trip over this: XFS: Assertion failed: nmaps == 1, file: fs/xfs/xfs_dquot.c, line: 360 Call Trace: xfs_dquot_disk_alloc+0x3dc/0x400 [xfs 97e1fa8953d397b1fb9732df4de7fa9070bda501] xfs_qm_dqread+0xc9/0x190 [xfs 97e1fa8953d397b1fb9732df4de7fa9070bda501] xfs_qm_dqget+0xa8/0x230 [xfs 97e1fa8953d397b1fb9732df4de7fa9070bda501] xfs_qm_vop_dqalloc+0x160/0x600 [xfs 97e1fa8953d397b1fb9732df4de7fa9070bda501] xfs_setattr_nonsize+0x318/0x520 [xfs 97e1fa8953d397b1fb9732df4de7fa9070bda501] notify_change+0x30e/0x490 chown_common+0x13e/0x1f0 do_fchownat+0x8d/0xe0 __x64_sys_fchownat+0x1b/0x20 do_syscall_64+0x2b/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fa6985e2cae The test injects the bmap_alloc_minlen_extent error, which refuses to allocate file space unless it's exactly minlen long. However, a precondition of this injection point is that the free space on the data device must be sufficiently fragmented that there are small free extents. However, if realtime and rtinherit are enabled, the punch-alternating call will operate on a realtime file, which only serves to write 0x55 patterns into the realtime bitmap. Hence the test preconditions are not satisfied, so the test is not serving its purpose. Fix it by disabling rtinherit=1 on the rootdir so that we actually fragment the bnobt/cntbt as required. Signed-off-by: Darrick J. Wong Reviewed-by: Andrey Albershteyn --- tests/xfs/529 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/xfs/529 b/tests/xfs/529 index 83d24da0ac..cd176877f5 100755 --- a/tests/xfs/529 +++ b/tests/xfs/529 @@ -32,6 +32,10 @@ echo "Format and mount fs" _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full _scratch_mount -o uquota >> $seqres.full +# bmap_alloc_minlen_extent only applies to the datadev space allocator, so +# we force the filesystem not to use the realtime volume. +_xfs_force_bdev data $SCRATCH_MNT + bsize=$(_get_file_block_size $SCRATCH_MNT) echo "* Delalloc to written extent conversion" From patchwork Mon Jul 3 17:03:44 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: 13300292 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 40054C001B0 for ; Mon, 3 Jul 2023 17:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbjGCRDr (ORCPT ); Mon, 3 Jul 2023 13:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbjGCRDq (ORCPT ); Mon, 3 Jul 2023 13:03:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAE96E58; Mon, 3 Jul 2023 10:03:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7924060FEF; Mon, 3 Jul 2023 17:03:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD46EC433C8; Mon, 3 Jul 2023 17:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688403824; bh=TMwy5ndrR4N1nNLEBC3BsHDB+L1wCBVqQsL9dDeCCPg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=u6yZNFEjjrCdT2SAo6e4SOex0u1KCnh7L/GVKNJe+kYvkiedxXkzKTY0rFHLIaEhE E6ZdSzsDs91HQi21Kw0PW8cx19z5UyNLWV1526II4FqpMkuKZ2f7cGs0LYDWG9H/xH vjC2aYkWjsu5obYFqWZ279Vh8Eko28HQXikfPtuogO3xeUAwGA5HZLB8uM9refOOoS nZkPfYptc9lCTwrjPjUOGXlFjQ31+XYY4tAobNXI7+BDTUtHj7cpO9GLRp9+zq2oM/ Ciy+Jd7j50smOEI5Zxge0OE0IZz0fRISp1gncfBO5W8RYaJa+zCyMC8qLo38EjlJN7 Ir7bXxw6Bqrtg== Subject: [PATCH 2/5] xfs/569: skip post-test fsck run 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: Mon, 03 Jul 2023 10:03:44 -0700 Message-ID: <168840382437.1317961.10711798856849951797.stgit@frogsfrogsfrogs> In-Reply-To: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> References: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong This test examines the behavior of mkfs.xfs with specific filesystem configuration files by formatting the scratch device directly with those exact parameters. IOWs, it doesn't include external log devices or realtime devices. If external devices are set up, the post-test fsck run fails because the filesystem doesnt' use the (allegedly) configured external devices. Fix that by adding _require_scratch_nocheck. Signed-off-by: Darrick J. Wong Reviewed-by: Andrey Albershteyn --- tests/xfs/569 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/569 b/tests/xfs/569 index e8902708bc..b6d5798058 100755 --- a/tests/xfs/569 +++ b/tests/xfs/569 @@ -14,7 +14,7 @@ _begin_fstest mkfs # Modify as appropriate. _supported_fs xfs -_require_scratch +_require_scratch_nocheck ls /usr/share/xfsprogs/mkfs/*.conf &>/dev/null || \ _notrun "No mkfs.xfs config files installed" From patchwork Mon Jul 3 17:03:50 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: 13300293 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 4302DC001B0 for ; Mon, 3 Jul 2023 17:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbjGCRDz (ORCPT ); Mon, 3 Jul 2023 13:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbjGCRDw (ORCPT ); Mon, 3 Jul 2023 13:03:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9BDE5D; Mon, 3 Jul 2023 10:03:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 15E1760FED; Mon, 3 Jul 2023 17:03:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7194BC433C8; Mon, 3 Jul 2023 17:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688403830; bh=58z7Srcl/+HK8KI8+j/I2YBIyXH/Q9jFH1Q/otFMx10=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=GlapZtFAyNXNAyXVZEjcai7ZO6fWyUG4JgBWY0crKYhZpp1UiQ6FiRsA1H2/0LqcU sbJVtdxgIKIaS9hMBSJ4kv3HgOz4Wx5dtI0JW8wbIIo+xlsEYYhgh+tsFhoHKCxgLc 2zF9v1hUI4MbwZCdXXjRd3+bfGZfOyp/vwYTsZQrCJqaZjDj4MmjAGjKrsPXerrR8a oGB/8OEyxgPsg2Ljn9Mb5dUU0EYghi984tfkTfIER/5eXZG5mqef+jE3JGpTDvvwhd 48FnXwRlD+S4/Bxuv4WDV3c/E1wz6pKpW1y9T2T991RHjqhvQDSsUaxtQGLgYUvNvh qeGasG4AYcMpA== Subject: [PATCH 3/5] xfs/439: amend test to work with new log geometry validation 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: Mon, 03 Jul 2023 10:03:50 -0700 Message-ID: <168840383001.1317961.12926483978316384291.stgit@frogsfrogsfrogs> In-Reply-To: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> References: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong An upcoming patch moves more log validation checks to the superblock verifier, so update this test as needed. Signed-off-by: Darrick J. Wong --- tests/xfs/439 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/xfs/439 b/tests/xfs/439 index b7929493d1..8c69ece655 100755 --- a/tests/xfs/439 +++ b/tests/xfs/439 @@ -21,7 +21,9 @@ _begin_fstest auto quick fuzzers log _supported_fs xfs _require_scratch_nocheck # We corrupt XFS on purpose, and check if assert failures would crash system. -_require_no_xfs_bug_on_assert +# This used to be _require_no_xfs_bug_on_assert, but now we've fixed the sb +# verifier to reject this before xfs_log_mount gets to it: +_fixed_by_kernel_commit XXXXXXXXXXXX "xfs: journal geometry is not properly bounds checked" rm -f "$seqres.full" @@ -33,7 +35,7 @@ blksz=$(_scratch_xfs_get_sb_field blocksize) _scratch_xfs_set_sb_field logsunit $((blksz - 1)) >> $seqres.full 2>&1 # Check if logsunit is set correctly -lsunit=$(_scratch_xfs_get_sb_field logsunit) +lsunit=$(_scratch_xfs_get_sb_field logsunit 2>/dev/null) [ $lsunit -ne $((blksz - 1)) ] && _notrun "failed to set sb_logsunit" # Mount and writing log may trigger a crash on buggy kernel From patchwork Mon Jul 3 17:03:55 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: 13300294 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 A0B08C3063F for ; Mon, 3 Jul 2023 17:03:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229928AbjGCRD7 (ORCPT ); Mon, 3 Jul 2023 13:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbjGCRD6 (ORCPT ); Mon, 3 Jul 2023 13:03:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2555FE58; Mon, 3 Jul 2023 10:03:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B1EB160CB9; Mon, 3 Jul 2023 17:03:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19C33C433C8; Mon, 3 Jul 2023 17:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688403836; bh=7vF9Ykyz8sEPqJVEUDNK2N3A9YJcJw+ETv1uuPxF8qY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PX0fs+cs0tmKftHi0upJeM98OfaPUQXw/GKQoTdJt4RaiEtIijy4nSURSIolEijPh g3UUe+NVrznEYZqSsgBqCFVvuGPtVS1WTgUTzUaAVOnuza+VnNi6V/YJ0/fb88g5Mi 5U6L6kGPl4WS13DZqyfG4nJnKv4HJoK3K3hub8RSyEOFA13YIVkDIZhcHKrxnw54BJ uoCGhptDEBXDv5WNCT++D+g8tU46O9kDq2+qwxSPMZqOZRNRJq33v2X/gjrcpqwqM+ snRawFRI/0wvsl3ZF3WAA7O0Ra/faSy57tjYI17EvUOqPB8QmhtWcO+nHR+f0wFG9K vIt6Su/heiMXQ== Subject: [PATCH 4/5] xfs/041: force create files on the data device 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: Mon, 03 Jul 2023 10:03:55 -0700 Message-ID: <168840383563.1317961.17059869339313726876.stgit@frogsfrogsfrogs> In-Reply-To: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> References: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Since we're testing growfs of the data device, we should create the files there, even if the mkfs configuration enables rtinherit on the root dir. Signed-off-by: Darrick J. Wong Reviewed-by: Andrey Albershteyn --- tests/xfs/041 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/xfs/041 b/tests/xfs/041 index 05de5578ff..21b3afe7ce 100755 --- a/tests/xfs/041 +++ b/tests/xfs/041 @@ -46,6 +46,9 @@ bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \ onemeginblocks=`expr 1048576 / $bsize` _scratch_mount +# We're growing the data device, so force new file creation there +_xfs_force_bdev data $SCRATCH_MNT + echo "done" # full allocation group -> partial; partial -> expand partial + new partial; From patchwork Mon Jul 3 17:04:01 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: 13300295 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 AD529C001B0 for ; Mon, 3 Jul 2023 17:04:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230392AbjGCREF (ORCPT ); Mon, 3 Jul 2023 13:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbjGCREE (ORCPT ); Mon, 3 Jul 2023 13:04:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DED4EE6E; Mon, 3 Jul 2023 10:04:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5B8F460FED; Mon, 3 Jul 2023 17:04:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBB16C433C7; Mon, 3 Jul 2023 17:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688403841; bh=IrK+rwVluqVnFZqxnddEEAKCG/mia1kycmBZhXOzrJU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=LFTkX6LZb0CkKZu4O7DmiOwfdf/a51iaSS0qSNBgUZ9xsLK8L9ItN9/fPrWo769Rl KoqaR8S5mXIKXhQAghaJEV/zOdVq+BVgvPj8DlkM2IvGAh6FkhG6Odwi44R7eTVqJ5 ScgO8ISKw4g9TTzeIijUiNepMC1/j+wogto97BoY2oBOv5GAAVDDrHxim4IF1auYyV Vuc+YuYL5cPmzs0aiQPGTOeAXixGPc35np3hogmsSALifs43mkpnVZGXrJVVLctfsx nKGTOgD7+fD8+LrkhOF6yq51G6q6IRp8qYOylbNSxQi48ov/myqJA4+vyP7D8Dagre SXOQLXnPMnSOw== Subject: [PATCH 5/5] xfs: test growfs of the realtime device 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: Mon, 03 Jul 2023 10:04:01 -0700 Message-ID: <168840384128.1317961.1554188648447496379.stgit@frogsfrogsfrogs> In-Reply-To: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> References: <168840381298.1317961.1436890061506567407.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Create a new test to make sure that growfs on the realtime device works without corrupting anything. Signed-off-by: Darrick J. Wong Reviewed-by: Andrey Albershteyn --- tests/xfs/934 | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/934.out | 19 +++++++++++++ 2 files changed, 98 insertions(+) create mode 100755 tests/xfs/934 create mode 100644 tests/xfs/934.out diff --git a/tests/xfs/934 b/tests/xfs/934 new file mode 100755 index 0000000000..f2db4050a7 --- /dev/null +++ b/tests/xfs/934 @@ -0,0 +1,79 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. +# +# FS QA Test No. 934 +# +# growfs QA tests - repeatedly fill/grow the rt volume of the filesystem check +# the filesystem contents after each operation. This is the rt equivalent of +# xfs/041. +# +. ./common/preamble +_begin_fstest growfs ioctl auto + +# Override the default cleanup function. +_cleanup() +{ + cd / + _scratch_unmount + rm -f $tmp.* +} + +# Import common functions. +. ./common/filter + +# real QA test starts here +_supported_fs xfs + +_require_scratch +_require_realtime +_require_no_large_scratch_dev +_scratch_unmount 2>/dev/null + +_fill() +{ + if [ $# -ne 1 ]; then echo "Usage: _fill \"path\"" 1>&2 ; exit 1; fi + _do "Fill filesystem" \ + "$here/src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest" +} + +_do_die_on_error=message_only +rtsize=32 +echo -n "Make $rtsize megabyte rt filesystem on SCRATCH_DEV and mount... " +_scratch_mkfs_xfs -rsize=${rtsize}m | _filter_mkfs 2> "$tmp.mkfs" >> $seqres.full +test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed" + +. $tmp.mkfs +onemeginblocks=`expr 1048576 / $dbsize` +_scratch_mount + +# We're growing the realtime device, so force new file creation there +_xfs_force_bdev realtime $SCRATCH_MNT + +echo "done" + +# full allocation group -> partial; partial -> expand partial + new partial; +# partial -> expand partial; partial -> full +# cycle through 33m -> 67m -> 75m -> 96m +for size in 33 67 75 96 +do + grow_size=`expr $size \* $onemeginblocks` + _fill $SCRATCH_MNT/fill_$size + _do "Grow filesystem to ${size}m" "xfs_growfs -R $grow_size $SCRATCH_MNT" + echo -n "Flush filesystem... " + _do "_scratch_unmount" + _do "_try_scratch_mount" + echo "done" + echo -n "Check files... " + if ! _do "$here/src/fill2fs_check $tmp.manifest"; then + echo "fail (see $seqres.full)" + _do "cat $tmp.manifest" + _do "ls -altrR $SCRATCH_MNT" + status=1 ; exit + fi + echo "done" +done + +# success, all done +echo "Growfs tests passed." +status=0 ; exit diff --git a/tests/xfs/934.out b/tests/xfs/934.out new file mode 100644 index 0000000000..07da1eb7cb --- /dev/null +++ b/tests/xfs/934.out @@ -0,0 +1,19 @@ +QA output created by 934 +Make 32 megabyte rt filesystem on SCRATCH_DEV and mount... done +Fill filesystem... done +Grow filesystem to 33m... done +Flush filesystem... done +Check files... done +Fill filesystem... done +Grow filesystem to 67m... done +Flush filesystem... done +Check files... done +Fill filesystem... done +Grow filesystem to 75m... done +Flush filesystem... done +Check files... done +Fill filesystem... done +Grow filesystem to 96m... done +Flush filesystem... done +Check files... done +Growfs tests passed.