From patchwork Mon Apr 11 22:54:22 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: 12809744 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 21473C433F5 for ; Mon, 11 Apr 2022 22:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245023AbiDKW4r (ORCPT ); Mon, 11 Apr 2022 18:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344838AbiDKW4p (ORCPT ); Mon, 11 Apr 2022 18:56:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77DA07656; Mon, 11 Apr 2022 15:54:25 -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 27C52B81996; Mon, 11 Apr 2022 22:54:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D984FC385A5; Mon, 11 Apr 2022 22:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649717662; bh=hrgCphgBIJbdExB7fwLsooVx23IiXP1/Sq2+Mu1APAQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PvIkidOj6GewYYIjKBa/w35YHI0CCzjuHBh6wgMpVK0j3H+4LlpoN7r/Hp0/boj9p zRoJ+dStrcWiJl3OAd511tYVnNyjLtXe43bxCF7q1a8XyXf3iJccS3zqUKWbkK5b/t YjKss7hVo/CQ6YN3stpkhak/B37QbxkzRWHd4vpM9/YO3YMBArm/rA5vPOZWGsDpQO Wq6WfNMTlB0JC9wbsifKp82E+F7fHKj/+s405qcfn1wRd0/RH0WXLiExTOsqyHMEbw A+pVpXgfr/xMKNHL90KXEUkahj0V8CDd8YbnVs/Ls28srAL64JO8PDavGoM7us7pw7 nv16Z757CDHTQ== Subject: [PATCH 1/2] xfs/187: don't rely on FSCOUNTS for free space data 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: Mon, 11 Apr 2022 15:54:22 -0700 Message-ID: <164971766238.169895.2389864738831855587.stgit@magnolia> In-Reply-To: <164971765670.169895.10730350919455923432.stgit@magnolia> References: <164971765670.169895.10730350919455923432.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 Currently, this test relies on the XFS_IOC_FSCOUNTS ioctl to return accurate free space information. It doesn't. Convert it to use statfs, which uses the accurate versions of the percpu counters. Obviously, this only becomes a problem when we convert the free rtx count to use (sloppier) percpu counters instead of the (more precise and previously buggy) ondisk superblock counts. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang --- tests/xfs/187 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/187 b/tests/xfs/187 index 1929e566..a9dfb30a 100755 --- a/tests/xfs/187 +++ b/tests/xfs/187 @@ -135,7 +135,7 @@ punch_off=$((bigfile_sz - frag_sz)) $here/src/punch-alternating $SCRATCH_MNT/bigfile -o $((punch_off / fsbsize)) -i $((rtextsize_blks * 2)) -s $rtextsize_blks # Make sure we have some free rtextents. -free_rtx=$($XFS_IO_PROG -c 'statfs' $SCRATCH_MNT | grep counts.freertx | awk '{print $3}') +free_rtx=$($XFS_IO_PROG -c 'statfs' $SCRATCH_MNT | grep statfs.f_bavail | awk '{print $3}') if [ $free_rtx -eq 0 ]; then echo "Expected fragmented free rt space, found none." fi From patchwork Mon Apr 11 22:54:28 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: 12809745 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 51877C433EF for ; Mon, 11 Apr 2022 22:54:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344838AbiDKW4v (ORCPT ); Mon, 11 Apr 2022 18:56:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346702AbiDKW4u (ORCPT ); Mon, 11 Apr 2022 18:56:50 -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 44A42A185; Mon, 11 Apr 2022 15:54:31 -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 394E9CE17B8; Mon, 11 Apr 2022 22:54:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CF7CC385A4; Mon, 11 Apr 2022 22:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649717668; bh=H7PQ+1qIo+gwxATV4ELYpqYdJ4udgEcBhBxS4xEOib0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=u2jupRsmtkq969cQnAPfvyHS7W9slxtMe/sPu/bU059OUPrdx4RJbb7MeQ5mE+VVy 6QAHjRT0qByWPfnhbfpjUs7uzCDBROr9GzD86/7By63KXJBgaQ8uUqx0m87YvN29y+ i+KD7LwJIZnwgpSgXLbs5btR+KAKCk+UJoWP1pX1Go/8xno0psVdTAOheEmWi3HCip UyIf6G1TtEIftJxzSwRFq2wG1q6QKRH6YHryRe05u0THW+xs76ZLKKkcgsLanJ2Syz WU6Wkwdkr3/EjHVdAB2XZA9CowYrhJMeF8WpmiUx8e/a47jNpbmvuhbaOyTBVfOSxH aN5sNPcIh3bgQ== Subject: [PATCH 2/2] xfs/507: add test to auto group 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: Mon, 11 Apr 2022 15:54:28 -0700 Message-ID: <164971766805.169895.12082898167045363438.stgit@magnolia> In-Reply-To: <164971765670.169895.10730350919455923432.stgit@magnolia> References: <164971765670.169895.10730350919455923432.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 this regression test to the auto group now that it's been quite a while since the fix patches went upstream. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang --- tests/xfs/507 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/xfs/507 b/tests/xfs/507 index aa3d8eeb..b9c9ab29 100755 --- a/tests/xfs/507 +++ b/tests/xfs/507 @@ -4,13 +4,17 @@ # # FS QA Test No. 507 # +# Regression test for kernel commit: +# +# 394aafdc15da ("xfs: widen inode delalloc block counter to 64-bits") +# # Try to overflow i_delayed_blks by setting the largest cowextsize hint # possible, creating a sparse file with a single byte every cowextsize bytes, # reflinking it, and retouching every written byte to see if we can create # enough speculative COW reservations to overflow i_delayed_blks. # . ./common/preamble -_begin_fstest clone +_begin_fstest auto clone _register_cleanup "_cleanup" BUS