From patchwork Wed Mar 12 23:11:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 14014046 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 CB0D31B0406; Wed, 12 Mar 2025 23:11:33 +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=1741821093; cv=none; b=GBuUiIojEaydTBxAdcWJs/JpilzJzqO0TUDskau/Gh4AJpswRiPR+KHuvARujYYe2l6NnED3vTLdk5GJGfV9pJZFDiU52ej7K1nEBJsPIZTRbe5DYpv72gVAjOEYxfEdU2dirdF0UR3EbR3PyaiAeTOh5YU5oHLeo2sQPagkp4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741821093; c=relaxed/simple; bh=oydxMkyc0hiknia09FS2tFcW+lBSuiAv++SGfwgd+xw=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EXFzeDFbIywL0+uwOfTyiXrhsizLkHCMZlBKoAsuaLvE3CxvT+vlkXTCIFhJKwj+78D1CswR5/vG6J0VQ07kMy90HnVmkXmEjgwQK51vN97eJonweiV7+h7JLj17/wkN8BpJguQVkNeSdUUphZ1N6540gGx9iTbdbBgMf+TFtFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UClANw0C; 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="UClANw0C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34424C4CEDD; Wed, 12 Mar 2025 23:11:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741821093; bh=oydxMkyc0hiknia09FS2tFcW+lBSuiAv++SGfwgd+xw=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=UClANw0Ca0uBUY8gzHqPhVql7DnXlQNZd1NtKLslySba1AQhaFcJi7p1XWru8HHg/ FqVcDN9bLvccAeZkU1rvB4mXE9g7kgvnGyoT5J01NEYco85bl3X98MDBsiBg/Pu5MO IfWkTZE4Sxp2SJ5q6MwGNal30Hfeuydn9JKeDOm8aY2nw0J+yglbOWQXhbdmcekm4G dzmqnobrsC5M+gnpWc+LFwtPok8d32Him9cydbIRBZY6bXBcurTsDTuEzr0g0uNETR Vj17UkpnJkdMq02nlPIDEZrv6wWFXH9NsH5m1dHCOoCWPRRL95hZUkFk2ruxYOzgAI 9fNKlOynZGKMQ== Date: Wed, 12 Mar 2025 16:11:32 -0700 Subject: [PATCH 1/3] xfs/614: determine the sector size of the fs image by doing a test format From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: hch@lst.de, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <174182089124.1400713.2560711587518324233.stgit@frogsfrogsfrogs> In-Reply-To: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> References: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong In some cases (such as xfs always_cow=1), the configuration of the test filesystem determines the sector size of the filesystem that we're going to simulate formatting. Concretely, even if TEST_DEV is a block device with 512b sectors, the directio geometry can specify 4k writes to avoid nasty RMW cycles. When this happens, mkfs.xfs will set the sector size to that 4k accordingly, but the golden output selection is wrong. Fix this. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- tests/xfs/614 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/xfs/614 b/tests/xfs/614 index 2a799fbf3ed71c..e182f073fddd64 100755 --- a/tests/xfs/614 +++ b/tests/xfs/614 @@ -25,13 +25,16 @@ _require_test $MKFS_XFS_PROG 2>&1 | grep -q concurrency || \ _notrun "mkfs does not support concurrency options" -test_dev_lbasize=$(blockdev --getss $TEST_DEV) -seqfull=$0 -_link_out_file "lba${test_dev_lbasize}" - +# Figure out what sector size mkfs will use to format, which might be dependent +# upon the directio write geometry of the test filesystem. loop_file=$TEST_DIR/$seq.loop - rm -f "$loop_file" +truncate -s 16M "$loop_file" +$MKFS_XFS_PROG -f -N "$loop_file" | _filter_mkfs 2>$tmp.mkfs >/dev/null +. $tmp.mkfs +seqfull=$0 +_link_out_file "lba${sectsz}" + for sz in 16M 512M 1G 2G 16G 64G 256G 512G 1T 2T 4T 16T 64T 256T 512T 1P; do for cpus in 2 4 8 16 32 40 64 96 160 512; do truncate -s "$sz" "$loop_file" From patchwork Wed Mar 12 23:11:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 14014047 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 61BBC1F12F1; Wed, 12 Mar 2025 23:11:49 +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=1741821109; cv=none; b=eQ0oBL+AbON8FwudALB5poOHL0ptz/DBr3FacUuutB5w1bIQzcSREcUJIfsQf2SNc1damRfcENWrQkOQZ44j4hb51sr36bmsxZCLApOge9EsHViRPBeiIgt93S74t0Tm4XCTMaaXcsT0ohtaVU4vgi7bWCD+DsLigS0ZcI4E88w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741821109; c=relaxed/simple; bh=7md1fT4J8la6NB8X5MqoHWWlkWJ5c5EnxluckLLYGjE=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RA8XBbZqFDt8H06SRfmRpJhkN00lJe/OFzh6TymKqSSYi1jKI50PltLsBOaQhx8XxZNa+30RMBM4J1Uo2V9JkH5+hwckG2U2g+tSIekWLyS90CuAgaEI2WVAWO0SJZjr3c7tkPRs7tjk0SQyHAaCRKfRdSv0aeJh+U44hn+C0qs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p2ljCGYA; 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="p2ljCGYA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1824C4CEE3; Wed, 12 Mar 2025 23:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741821108; bh=7md1fT4J8la6NB8X5MqoHWWlkWJ5c5EnxluckLLYGjE=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=p2ljCGYALIp/LraDbuuPJdG+KZh3BFq3edEhQ2azYQWYy0DuZ5b2sXxCJEfRdq0uG H27c2Gg9aSKQ7Pb24/elM5/5aATcRGhrIfjAIx7imMZM9S/XC+/pfWL6iUa1vrYp9b ZLoCn2TSbac8VjbcwDujt0GgV0+Kcy8jZhBXSCwzEEq5aUL5taXGhq9wRGFWtmtjbt m4K91FJlPcWX5SBa+EgwcSAUNgXSP/q1FjAIW44BdDy+WOo7YNchFdIajyYy+TZTin ZuOJ2L53q/j6TS6Fu1MjMoAReJJq78uVDPevLs5qFUPDgInjw4eN/fSU8moUGwdoOH UthMH9G8TeWDA== Date: Wed, 12 Mar 2025 16:11:48 -0700 Subject: [PATCH 2/3] generic/537: disable quota mount options for pre-metadir rt filesystems From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <174182089142.1400713.12586249978501158339.stgit@frogsfrogsfrogs> In-Reply-To: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> References: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Fix this regression in generic/537: mount: /opt: permission denied. dmesg(1) may have more information after failed mount system call. mount -o uquota,gquota,pquota, -o ro,norecovery -ortdev=/dev/sdb4 /dev/sda4 /opt failed mount -o uquota,gquota,pquota, -o ro,norecovery -ortdev=/dev/sdb4 /dev/sda4 /opt failed (see /var/tmp/fstests/generic/537.full for details) for reasons explained in the giant comment. TLDR: quota and rt aren't compatible on older xfs filesystems so we have to work around that. Signed-off-by: "Darrick J. Wong" --- tests/generic/537 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/generic/537 b/tests/generic/537 index f57bc1561dd57e..3be743c4133f4f 100755 --- a/tests/generic/537 +++ b/tests/generic/537 @@ -18,6 +18,7 @@ _begin_fstest auto quick trim # Import common functions. . ./common/filter +. ./common/quota _require_scratch _require_fstrim @@ -36,6 +37,22 @@ _scratch_mount -o ro >> $seqres.full 2>&1 $FSTRIM_PROG -v $SCRATCH_MNT >> $seqres.full 2>&1 _scratch_unmount +# As of kernel commit 9f0902091c332b ("xfs: Do not allow norecovery mount with +# quotacheck"), it is no longer possible to mount with "norecovery" and any +# quota mount option if the quota mount options would require a metadata update +# such as quotacheck. For a pre-metadir XFS filesystem with a realtime volume +# and quota-enabling options, the first two mount attempts will have succeeded +# but with quotas disabled. The mount option parsing for this next mount +# attempt will see the same quota-enabling options and a lack of qflags in the +# ondisk metadata and reject the mount because it thinks that will require +# quotacheck. Edit out the quota mount options for this specific +# configuration. +if [ "$FSTYP" = "xfs" ]; then + if [ "$USE_EXTERNAL" = "yes" ] && [ -n "$SCRATCH_RTDEV" ]; then + _qmount_option "" + fi +fi + echo "fstrim on ro mount with no log replay" norecovery="norecovery" test $FSTYP = "btrfs" && norecovery=nologreplay From patchwork Wed Mar 12 23:12:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 14014048 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 9B01F1F1508; Wed, 12 Mar 2025 23:12:04 +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=1741821124; cv=none; b=qk8bsFp+cz7/F4FELBE4qyc9iTH06828KNRaduKlwTpvNguTJ624HTvA+UtPmDuSFC2rr7DYNKTE2WoaqfDiFAt728jncHHM8NMT2aOBQ7Rn3an0KZdu9A9+xrcuLZTK2aNg0YhSX4NGzzeg1SCsyJgWzhGPJ9LHSbETpMFN1zk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741821124; c=relaxed/simple; bh=ecpk6l1eGopc7pVscXzS4Cc9+7gjRfUu9VQF56iisFw=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MkF0naNUdLG1d7u2uFJt1Krn+MOqNVNDWBklEEgXjqj+QeDgQKmhz5OnUbP8+/UbRwxRffvcFlG6UOT6MSROGIhWzSd5G5TrNrzmOMl5o6b0gCuyGWL0ZvsT/kSFWr0GQeyPEGk45cGUg48Car2GWicz5v2Q+91YFrEOcar/DdA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SZbgA+X4; 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="SZbgA+X4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 702A0C4CEDD; Wed, 12 Mar 2025 23:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741821124; bh=ecpk6l1eGopc7pVscXzS4Cc9+7gjRfUu9VQF56iisFw=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=SZbgA+X4oQ9ZLxB2m5fXj7KhuKnqyLN6MH/rpfbJUNGjUkffoknDE5h0BHGrjpJEq my8qb5Fo7n0Bkvs4FRulMoZFyIc669z9MgKdF1V1agDBpfYcn7lshmPTKGJvA267hm a9WWaJEdDnqcmTuYsNDZSRl3rMxenn7AE9myNXDLKfid/qe8GpVC4Djv8fO6UAkDuu JaRqa+eGTOVoncVZBEQMOD6OvYyyxypQwtk0Bz8QFMjHiYFr0jw4OVkLwD1CheDINS dp3qV78eMP9qmAIBsw7f7FZuO4PqkWO3mqQWO5Wy9U+jYpBR2Qoxldpw4kX01cn2Ig 9COZbxbCMClMg== Date: Wed, 12 Mar 2025 16:12:04 -0700 Subject: [PATCH 3/3] check: don't allow TEST_DIR/SCRATCH_MNT to be in /tmp From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Message-ID: <174182089161.1400713.6024925682002640886.stgit@frogsfrogsfrogs> In-Reply-To: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> References: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> 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 running in a private mount namespace, /tmp is a private tmpfs mount. Using TEST_DIR/SCRATCH_MNT that point there is a bad idea because anyone can write to there. Let's just stop that. Signed-off-by: "Darrick J. Wong" --- check | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/check b/check index 33eb3e0859e578..09134ee63e41e2 100755 --- a/check +++ b/check @@ -815,6 +815,20 @@ function run_section() echo "SECTION -- $section" fi + # If we're running in a private mount namespace, /tmp is a private + # directory. We /could/ just mkdir it, but we'd rather have people + # set those paths elsewhere. + if [ "$HAVE_PRIVATENS" = yes ] && [[ $TEST_DIR =~ ^\/tmp ]]; then + echo "$TEST_DIR: TEST_DIR must not be in /tmp" + status=1 + exit + fi + if [ "$HAVE_PRIVATENS" = yes ] && [[ $SCRATCH_MNT =~ ^\/tmp ]]; then + echo "$SCRATCH_MNT: SCRATCH_MNT must not be in /tmp" + status=1 + exit + fi + sect_start=`_wallclock` if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ]; then echo "RECREATING -- $FSTYP on $TEST_DEV" From patchwork Fri Mar 14 17:54:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 14017298 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 6213A20371B; Fri, 14 Mar 2025 17:54:49 +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=1741974890; cv=none; b=sLvrXto76qKFbxP0Eg2aVmBLxC3MK3M3YVPBn76TtDFGf7bERb2j/6ypHtn2lCG+W5xFHviy9HIs6nEY1quHlGz4Cr1ubDfeIaZ2ezesHPcnDS+lHduVaLsYShJRWQdlBCX0x2W9JdTi9p51itih4xy4L9LUIv4M8iipLuQzJwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741974890; c=relaxed/simple; bh=eMn5uhKQRhhROLSyUc/9TF6dv1QMKVKhjXWXlk6v+gc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GY3xoY2S53MlkxL942BD3Vs3cGozegBSyWdAMNpqREDyccTlNJ1/4Q4VbwMtoU9a5wXxhqMVViRfNiTRA2KqearzEi6Rymqu5rgG9u02oNmpNhwXOScuOp5P1DS3uPT9v28nBLXBnut6/AsTlpHqmUFxOX7ViJjpNL/zNb7P/2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h06Kk1D6; 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="h06Kk1D6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7644C4CEE3; Fri, 14 Mar 2025 17:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741974889; bh=eMn5uhKQRhhROLSyUc/9TF6dv1QMKVKhjXWXlk6v+gc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h06Kk1D6uk97VJMMWcGqSPk4mdEJRqkoTQGNIvZKzedxEbnGGtWHPdVFdQgiZt+g5 Y4mga7mc6BE2sNWnSrokC7GWucdgQkNR6+Kt5/6jaC1tWxUDn50JRS5gKTNMfTOeOf M93IwKXLihG+w87PBSXoayrT/gi1/AM+Aw/s89HxkfR5Pm4Zi9Hxzz7rrlGmro8sLA hq91VaB2YvRVMA146FIhaDFLNwT41zhZvMksUY+mvobJ9YqcUVkns1Ta0jRJy6JnKR HJD2y8M+rAGklsdGzm0tar2i2d+jaTvtjzVg6J+lHBVMT3JO1jSY9nwAeGVAoraNaP csl7jYKye/+rg== Date: Fri, 14 Mar 2025 10:54:49 -0700 From: "Darrick J. Wong" To: zlang@redhat.com Cc: hch@lst.de, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 4/3] common/populate: drop fallocate mode 0 requirement Message-ID: <20250314175449.GL2803740@frogsfrogsfrogs> References: <20250312230736.GS2803749@frogsfrogsfrogs> <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> From: Darrick J. Wong None of the _scratch_$FSTYP_populate functions use fallocate mode 0 (aka preallocation) to run, so drop the _require check. This enables xfs/349 and friends to work on always-cow xfs filesystems. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- common/populate | 1 - 1 file changed, 1 deletion(-) diff --git a/common/populate b/common/populate index a1be26d5b24adf..7352f598a0c700 100644 --- a/common/populate +++ b/common/populate @@ -8,7 +8,6 @@ . ./common/quota _require_populate_commands() { - _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" _require_test_program "punch-alternating" _require_test_program "popdir.pl" From patchwork Fri Mar 21 16:54:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 14025808 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 F310A22D4F3; Fri, 21 Mar 2025 16:54:19 +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=1742576061; cv=none; b=jKPGVbqrVIQ5moSThVWJpqyrVcHt7MNvavXIqS+n5LmMu83TbByEAvO0V3gphXOq25hdliphH63UGgxOG5YpNhTpZBMpM1rJVZvAyvovyBV8W1VOgugMFCRMy4P70N188qR1NyxKi8BKWv9m4dPAuLyW2qoGnQae7tWspX2dMPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742576061; c=relaxed/simple; bh=8dUJmfPs4S10R56woWhthw8lqM8k9CXT9AERs+VsvAU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nl3xUqjaSZe+v429bREGlNjK2bdbbra/VZgfQztSTYwQUHN6U6ApNTsJoKJdV7xWPO3ok7W3PRm5cHCs9tZlqfGSOvWPjjWwPI6SCMVb95pqL9Tvoz9jK02CRpNy4P6NKO5LiVUYEUzg+nOvPfD9y1Tdje1mueZ0Z5ZqsCv7GaU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=trQPcVRk; 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="trQPcVRk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6527AC4CEE8; Fri, 21 Mar 2025 16:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742576059; bh=8dUJmfPs4S10R56woWhthw8lqM8k9CXT9AERs+VsvAU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=trQPcVRkyMM8rHbdft3UyOh9Bs2kmMcV5L+On1c4kPjGH2kjvbO6F76Rwtl3esEEp V81br/TsFgaB0PvbVAw9invNYH5UUh4bQKwSebwSdJsnfMmswb1xf8K4K0g1j9RCRF F9BniosWgD4Z/ihRA9AGtrFMt/cmtsjGGzS15KuJbfXH4iMS+8ErDd+Rwgs9TXaaF+ 1JDHtbHZVDyfvBO6G9LH0Ngnxh4L5k7b9FVKeHxZG2M9N5AvKVsecmEVZGX1CfgWW4 vVOMs5peI2AZv80DzFb52bqLEtOYsAuaezuT8TeXvZb1e2JS7ILcZ1ud7ilwyNod3X QmEZPjetJL1Gg== Date: Fri, 21 Mar 2025 09:54:18 -0700 From: "Darrick J. Wong" To: zlang@redhat.com Cc: hch@lst.de, linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 5/3] xfs/818: fix some design issues Message-ID: <20250321165418.GP2803749@frogsfrogsfrogs> References: <20250312230736.GS2803749@frogsfrogsfrogs> <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <174182089094.1400713.5283745853237966823.stgit@frogsfrogsfrogs> From: Darrick J. Wong While QA'ing zoned filesystem support, I discovered some design errors in this test: 1) Since we're test formatting a sparse file on an xfs filesystem, there's no need to play games with optimal device size; we can create a totally sparse file that's the same size as SCRATCH_DEV. 2) mkfs.xfs cannot create realtime files, so if it fails with that, there's no need to continue the test. 3) If mkfs -p fails for none of the proscribed reasons, it should exit the test. The final cat $tmp.mkfs will take care of tweaking the golden output to register the test failure for further investigation. Cc: # v2025.03.09 Fixes: 6d39dc34e61e11 ("xfs: test filesystem creation with xfs_protofile") Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- tests/xfs/818 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/xfs/818 b/tests/xfs/818 index aeb462353df7e9..bc809390b9e340 100755 --- a/tests/xfs/818 +++ b/tests/xfs/818 @@ -75,9 +75,8 @@ _run_fsstress -n 1000 -d $SCRATCH_MNT/newfiles make_stat $SCRATCH_MNT before make_md5 $SCRATCH_MNT before -kb_needed=$(du -k -s $SCRATCH_MNT | awk '{print $1}') -img_size=$((kb_needed * 2)) -test "$img_size" -lt $((300 * 1024)) && img_size=$((300 * 1024)) +scratch_sectors="$(blockdev --getsz $SCRATCH_DEV)" +img_size=$((scratch_sectors * 512 / 1024)) echo "Clone image with protofile" $XFS_PROTOFILE_PROG $SCRATCH_MNT > $testfiles/protofile @@ -99,7 +98,21 @@ if ! _try_mkfs_dev -p $testfiles/protofile $testfiles/image &> $tmp.mkfs; then if grep -q 'No space left on device' $tmp.mkfs; then _notrun "not enough space in filesystem" fi + + # mkfs cannot create realtime files. + # + # If zoned=1 is in MKFS_OPTIONS, mkfs will create an internal realtime + # volume with rtinherit=1 and fail, so we need to _notrun that case. + # + # If zoned=1 is /not/ in MKFS_OPTIONS, we didn't pass a realtime device + # to mkfs so it will not create realtime files. The format should work + # just fine. + if grep -q 'creating realtime files from proto file not supported' $tmp.mkfs; then + _notrun "mkfs cannot create realtime files" + fi + cat $tmp.mkfs + exit fi _mount $testfiles/image $testfiles/mount