linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs/187: don't rely on FSCOUNTS for free space data
Date: Tue, 12 Apr 2022 16:47:16 +0800	[thread overview]
Message-ID: <20220412084716.vwljkrc7bpnzl75z@zlang-mailbox> (raw)
In-Reply-To: <164971766238.169895.2389864738831855587.stgit@magnolia>

On Mon, Apr 11, 2022 at 03:54:22PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> 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 <djwong@kernel.org>
> ---
>  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}')

Do you mean the "cnt->freertx = mp->m_sb.sb_frextents" in xfs_fs_counts() isn't
right?

Thanks,
Zorro

>  if [ $free_rtx -eq 0 ]; then
>  	echo "Expected fragmented free rt space, found none."
>  fi
> 


  reply	other threads:[~2022-04-12 10:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 22:54 [PATCHSET 0/2] fstests: random fixes Darrick J. Wong
2022-04-11 22:54 ` [PATCH 1/2] xfs/187: don't rely on FSCOUNTS for free space data Darrick J. Wong
2022-04-12  8:47   ` Zorro Lang [this message]
2022-04-12 17:11     ` Darrick J. Wong
2022-04-13 18:23       ` Zorro Lang
2022-04-11 22:54 ` [PATCH 2/2] xfs/507: add test to auto group Darrick J. Wong
2022-04-12  8:47   ` Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220412084716.vwljkrc7bpnzl75z@zlang-mailbox \
    --to=zlang@redhat.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).