From patchwork Thu Jun 20 20:58:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13706372 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 0610874267; Thu, 20 Jun 2024 20:58:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718917126; cv=none; b=PnavNfEvwxb/5FmddiE1UP6LfNulJAg8DintPmEw5PZXKHmezEsk7cFEOnGDDmFKIRRS+KmGMWDENG1lM8C3rVnun44pqGqjxmqySrhskubz0gTHEg3zIbKAW9kZv70S3X6eDc2miUHkEjI/77RJInr/inqHioZak1uYQPGWtGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718917126; c=relaxed/simple; bh=EI5+XgB4583IhijoQlbEVIbwxUKPKGNVDzW70ppEqsE=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jCJSO5OgGQrTarsYQ4YIMPkAYL9t0rnSxLSG6QxOMVPhxUJ7/Gklx2Mv8t1HPQfUjA0lOr+pNgNNwsIZEyYEqtFtlrHtbU33tkGObg7fuV6FyzAK6QP81Dc7QZbDDO2ypcZWcgmnSA1lx04bdA41wT0PxfTPBFKSpKWcan9LyNc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ASixN841; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ASixN841" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3929C2BD10; Thu, 20 Jun 2024 20:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718917125; bh=EI5+XgB4583IhijoQlbEVIbwxUKPKGNVDzW70ppEqsE=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=ASixN841IQ4lg4xEnHHx2TLVQIYOpjK8VEj3x++n1tnjl533Z8lzw4YocHkMh1ZLV 7ru/3M7XG0dbx8LofBxIB31cRba3d0PTNx43E/EgmCvQCa+TceX/SToN5BbAHQEt0+ muWODz9ev4nwpRB7h8ETHllWoOykOauiSBYr2fm8t4ZGmBx8bjwsJBdRu/M3KTeG6q mkf0TGmY18NWAe8QxOfYXR0MZHbjU9VRTl/ZfQtVY4mNLjbVnXIBuwoaVNRnPWfjtn rl+hlkg0d8NoaDtzO+7HnIJ/PE3T8Sed9awppZ8CynbVz+Zsx/9g+0INlXDeQijN2I aab9xaWq3Um9A== Date: Thu, 20 Jun 2024 13:58:45 -0700 Subject: [PATCH 07/11] xfs/306: fix formatting failures with parent pointers From: "Darrick J. Wong" To: djwong@kernel.org, zlang@redhat.com Cc: Christoph Hellwig , fstests@vger.kernel.org, allison.henderson@oracle.com, catherine.hoang@oracle.com, linux-xfs@vger.kernel.org Message-ID: <171891669746.3035255.11485056050489942000.stgit@frogsfrogsfrogs> In-Reply-To: <171891669626.3035255.15795876594098866722.stgit@frogsfrogsfrogs> References: <171891669626.3035255.15795876594098866722.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 parent pointers feature isn't supported on tiny 20MB filesystems because the larger directory transactions result in larger minimum log sizes, particularly with nrext64 enabled: ** mkfs failed with extra mkfs options added to " -m rmapbt=0, -i nrext64=1, -n parent=1," by test 306 ** ** attempting to mkfs using only test 306 options: -d size=20m -n size=64k ** max log size 5108 smaller than min log size 5310, filesystem is too small We don't support 20M filesystems anymore, so bump the filesystem size up to 100M and skip this test if we can't actually format the filesystem. Convert the open-coded punch-alternating logic into a call to that program to reduce execve overhead, which more than makes up having to write 5x as much data to fragment the free space. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- tests/xfs/306 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/xfs/306 b/tests/xfs/306 index b57bf4c0a9..152971cfc3 100755 --- a/tests/xfs/306 +++ b/tests/xfs/306 @@ -23,6 +23,7 @@ _supported_fs xfs _require_scratch_nocheck # check complains about single AG fs _require_xfs_io_command "fpunch" _require_command $UUIDGEN_PROG uuidgen +_require_test_program "punch-alternating" # Disable the scratch rt device to avoid test failures relating to the rt # bitmap consuming all the free space in our small data device. @@ -30,7 +31,8 @@ unset SCRATCH_RTDEV # Create a small fs with a large directory block size. We want to fill up the fs # quickly and then create multi-fsb dirblocks over fragmented free space. -_scratch_mkfs_xfs -d size=20m -n size=64k >> $seqres.full 2>&1 +_scratch_mkfs_xfs -d size=100m -n size=64k >> $seqres.full 2>&1 || \ + _notrun 'could not format tiny scratch fs' _scratch_mount # Fill a source directory with many largish-named files. 1k uuid-named entries @@ -49,10 +51,7 @@ done $XFS_IO_PROG -xc "resblks 16" $SCRATCH_MNT >> $seqres.full 2>&1 dd if=/dev/zero of=$SCRATCH_MNT/file bs=4k >> $seqres.full 2>&1 $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/file >> $seqres.full 2>&1 -size=`_get_filesize $SCRATCH_MNT/file` -for i in $(seq 0 8192 $size); do - $XFS_IO_PROG -c "fpunch $i 4k" $SCRATCH_MNT/file >> $seqres.full 2>&1 -done +$here/src/punch-alternating $SCRATCH_MNT/file # Replicate the src dir several times into fragmented free space. After one or # two dirs, we should have nothing but non-contiguous directory blocks.