From patchwork Wed Sep 28 04:23:56 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: 12991590 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 8ED8FC32771 for ; Wed, 28 Sep 2022 04:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232396AbiI1EYG (ORCPT ); Wed, 28 Sep 2022 00:24:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiI1EYF (ORCPT ); Wed, 28 Sep 2022 00:24:05 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD7131F0CC4; Tue, 27 Sep 2022 21:24:00 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id 1A5E5CE1C97; Wed, 28 Sep 2022 04:23:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E221C433D7; Wed, 28 Sep 2022 04:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664339037; bh=V4h51d+ua7GW3fU3EViOo0W9xNrgUeYysAH+Um2ll+Q=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=qZdyYqkKslaiuUUR/n+bz2SS33dmnQLnq4tZFngLMDrNqxzmpDJ9Twe3nSnCGHagC EkWZXIIVLB6bPL6NHb9IrUg154CryFyLF3UIZMXpMkstewFA4I1VncOofyLRs8fc6f g3olZLRMrN5OipCDaD44yz13ndyuZxWJCHQXCuHlZnp+tLCjvJ4k72RVLH37vjakD4 /+CK451cyFQviwI79eV1OvQcm9n4/063fRWVB9xyujLvyFwPGK3EAIbvW4YmtQS6nY ZVrTHjW3mI+OqV590aGeuiQ822nmWE9ojgUqbq8GhuJK0lEe8GqivH3OTnwtS0PKi5 Lvc32mBO7cEPg== Subject: [PATCH 1/3] generic/092: skip test if file allocation unit isn't aligned From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 27 Sep 2022 21:23:56 -0700 Message-ID: <166433903671.2008389.15875549373880546579.stgit@magnolia> In-Reply-To: <166433903099.2008389.13181182359220271890.stgit@magnolia> References: <166433903099.2008389.13181182359220271890.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 This test exercises allocation behavior when truncating a preallocated file down to 5M and then up to 7M. If those two sizes aren't aligned with the file allocation unit length, then the FIEMAP output will show blocks beyond EOF. That will cause trouble with the golden output, so skip this test if that will be the case. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang --- tests/generic/092 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/generic/092 b/tests/generic/092 index 505e0ec84f..d7c93ca792 100755 --- a/tests/generic/092 +++ b/tests/generic/092 @@ -28,6 +28,12 @@ _require_test _require_xfs_io_command "falloc" _require_xfs_io_command "fiemap" +# If the truncation sizes (5M/7M) aren't aligned with the file allocation unit +# length, then the FIEMAP output will show blocks beyond EOF. That will cause +# trouble with the golden output, so skip this test if that will be the case. +_require_congruent_file_oplen $TEST_DIR $((5 * 1048576)) +_require_congruent_file_oplen $TEST_DIR $((7 * 1048576)) + # First test to make sure that truncating at i_size trims the preallocated bit # past i_size $XFS_IO_PROG -f -c "falloc -k 0 10M" -c "pwrite 0 5M" -c "truncate 5M"\ From patchwork Wed Sep 28 04:24:02 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: 12991591 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 53868C6FA8E for ; Wed, 28 Sep 2022 04:24:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232443AbiI1EYI (ORCPT ); Wed, 28 Sep 2022 00:24:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232351AbiI1EYG (ORCPT ); Wed, 28 Sep 2022 00:24:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D99D81F0CC9; Tue, 27 Sep 2022 21:24:03 -0700 (PDT) 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 7509561CFF; Wed, 28 Sep 2022 04:24:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8576C433C1; Wed, 28 Sep 2022 04:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664339042; bh=z1BRi0w24pOjEjjn9U9SFzIwOxauLH057YDb3rjxxEI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=dn42Uh+0KPJy0rJgrl9jsP/HE2LkBwbcX44zhcJW4TaEqSLONyhJA/rB3otP9U2hN 5To3RlDnHjJ7R4oo1qlU9Q+ModVLfFWrOByOOgmYQPERi6aJZPQFgHAszXp1NloFqZ phlPnAH710SqoayIhPNlNOLLJtd3PaH2PpXXzO4qfkL9lh1hJeKyjLNfaIJWY12Lc9 JkcJagphX020ICRaZs7q5TJpcnXyxlOntJVcbKzeKO8n9XaOcIFoQATY1eZc0PIlzl oWVu++oVnACVYog6YVCNTllWpoLzExTkeAdIpwAUd6ugxV3fo/VFrMR6G2CBGalBqC U2m0PfWz6Lc4w== Subject: [PATCH 2/3] xfs/114: fix missing reflink requires From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 27 Sep 2022 21:24:02 -0700 Message-ID: <166433904232.2008389.13820157130628464952.stgit@magnolia> In-Reply-To: <166433903099.2008389.13181182359220271890.stgit@magnolia> References: <166433903099.2008389.13181182359220271890.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 This test both requires cp --reflink and the scratch filesystem to support reflink. Add the missing _requires calls. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang --- tests/xfs/114 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/xfs/114 b/tests/xfs/114 index 3aec814a5d..858dc3998e 100755 --- a/tests/xfs/114 +++ b/tests/xfs/114 @@ -18,6 +18,8 @@ _begin_fstest auto quick clone rmap collapse insert # real QA test starts here _supported_fs xfs _require_test_program "punch-alternating" +_require_cp_reflink +_require_scratch_reflink _require_xfs_scratch_rmapbt _require_xfs_io_command "falloc" _require_xfs_io_command "fcollapse" From patchwork Wed Sep 28 04:24:08 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: 12991592 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 48229C32771 for ; Wed, 28 Sep 2022 04:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232294AbiI1EYO (ORCPT ); Wed, 28 Sep 2022 00:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbiI1EYN (ORCPT ); Wed, 28 Sep 2022 00:24:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F7C21F0CCC; Tue, 27 Sep 2022 21:24:11 -0700 (PDT) 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 E6EB9B81D8C; Wed, 28 Sep 2022 04:24:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C866C433D7; Wed, 28 Sep 2022 04:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664339048; bh=JA6mvEbDZAouL4QURVEUZ2yhliMS1k/I6q2fnr/+aRI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=QqTlPRfVlZFspwseAQiY/4diT4YbwCj97vbBnN6YxrqQSS7WZNtbQMll/mrDY7bZI AyMQsAw7PuxTCWe0QP+0haiCWCeDQdUSk+OH1YkDDniBSAHv4DbBHFoDeHSgLJUa/o CXnCqf1e1FEdGr+0Dovh/oKz5MxBnTtD9jOLU1ATKZzkq1VvqEtzYwb4KL3PzyCun3 8T1EBahOgM1Eu9XqKPYwf6t15h97rTzgb4VAXieLGONQyrsiGj3J0XP2O/5U+bxYMR wLu+O4XCR+36q2acOm0KMlnDz6q5bvvO6qVrpBSaeAk5hq+TBwgdRxsU+MkxryYkLP vU7vGtST/Ezkg== Subject: [PATCH 3/3] xfs/229: do not _xfs_force_bdev on TEST_DIR From: "Darrick J. Wong" To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me Date: Tue, 27 Sep 2022 21:24:08 -0700 Message-ID: <166433904802.2008389.15649565619122354418.stgit@magnolia> In-Reply-To: <166433903099.2008389.13181182359220271890.stgit@magnolia> References: <166433903099.2008389.13181182359220271890.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 In commit ea15099b71, I observed that this test tries to test the behavior of the extent size hint on the data device. If the test runner set up MKFS_OPTIONS such that the filesystem gets created with a realtime section and rtinherit set on the root directory, then the preconditions of this test (creating files on the data section) is not satisfied and the results of this test are incorrect. The solution was to force all files created by this test to be assigned to the data section. Unfortunately, the correction that I made has side effects beyond this test -- by clearing rtinherit on $TEST_DIR, all tests that run after this one will create files on the data section, because the test filesystem persists for the duration of the entire test run. This leads to the wrong things being tested. Fix this new problem by clearing the rtinherit flag on $TDIR, which contains the files created by this test and is removed during cleanup, and leave a few comments celebrating our new discoveries. Fixes: ea15099b71 ("xfs: force file creation to the data device for certain layout tests") Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang --- common/xfs | 3 +++ tests/xfs/229 | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common/xfs b/common/xfs index 170dd621a1..e1c15d3d04 100644 --- a/common/xfs +++ b/common/xfs @@ -201,6 +201,9 @@ _xfs_get_file_block_size() # For each directory, each file subsequently created will target the given # device for file data allocations. For each empty regular file, each # subsequent file data allocation will be on the given device. +# +# NOTE: If you call this on $TEST_DIR, you must reset the rtinherit flag state +# before the end of the test to avoid polluting subsequent tests. _xfs_force_bdev() { local device="$1" diff --git a/tests/xfs/229 b/tests/xfs/229 index 2221b9c49c..a58fd16bba 100755 --- a/tests/xfs/229 +++ b/tests/xfs/229 @@ -31,11 +31,16 @@ _require_fs_space $TEST_DIR 3200000 TDIR="${TEST_DIR}/t_holes" NFILES="10" EXTSIZE="256k" -_xfs_force_bdev data $TEST_DIR # Create the test directory mkdir ${TDIR} +# Per-directory extent size hints aren't particularly useful for files that +# are created on the realtime section. Force the test file to be created on +# the data directory. Do not change the rtinherit flag on $TEST_DIR because +# that will affect other tests. +_xfs_force_bdev data $TDIR + # Set the test directory extsize $XFS_IO_PROG -c "extsize ${EXTSIZE}" ${TDIR}