FS/XFS testing framework
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com, fstests@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs: inline enable_quota helper in test 301
Date: Fri, 15 May 2026 14:15:49 -0700	[thread overview]
Message-ID: <20260515211549.GA3470939@zen.localdomain> (raw)
In-Reply-To: <agU-k5OnlkvcLiFB@zlang-mailbox>

On Thu, May 14, 2026 at 11:34:00AM +0800, Zorro Lang wrote:
> On Tue, May 12, 2026 at 05:43:33PM -0700, Boris Burkov wrote:
> > The enable_quota helper in btrfs/301 takes a mode argument ('n', 's',
> > or anything else) to switch between "no quota", "simple quota", and
> > "full quota" enable.  Only the simple-quota path is ever exercised by
> > this test, so the dispatch is dead weight and the indirection just
> > obscures the actual btrfs command being run.
> > 
> > Inline the two call sites to call 'btrfs quota enable --simple'
> > directly and drop the helper.
> > 
> > Signed-off-by: Boris Burkov <boris@bur.io>
> > ---
> 
> Hahah, to be honest, the title '[PATCH 0/2] squota delete fstests' gave me
> a minor heart attack. I thought it was a critical bug report about fstests
> accidentally deleting itself while running :-D
> 

Oops, sorry!

> >  tests/btrfs/301 | 14 ++------------
> >  1 file changed, 2 insertions(+), 12 deletions(-)
> > 
> > diff --git a/tests/btrfs/301 b/tests/btrfs/301
> > index 1f72a97b..31243aab 100755
> > --- a/tests/btrfs/301
> > +++ b/tests/btrfs/301
> > @@ -169,16 +169,6 @@ do_enospc_falloc()
> >  	do_falloc $file $sz
> >  }
> >  
> > -enable_quota()
> > -{
> > -	local mode=$1
> > -
> > -	[ $mode == "n" ] && return
> > -	arg=$([ $mode == "s" ] && echo "--simple")
> > -
> > -	$BTRFS_UTIL_PROG quota enable $arg $SCRATCH_MNT
> > -}
> > -
> >  get_subvid() > >  {
> >  	_btrfs_get_subvolid $SCRATCH_MNT subv
> > @@ -198,7 +188,7 @@ prepare()
> >  {
> >  	_scratch_mkfs >> $seqres.full
> >  	_scratch_mount
> > -	enable_quota "s"
> > +	$BTRFS_UTIL_PROG quota enable --simple $SCRATCH_MNT
> >  	$BTRFS_UTIL_PROG subvolume create $subv >> $seqres.full
> >  	local subvid=$(get_subvid)
> >  	set_subvol_limit $subvid $limit
> > @@ -421,7 +411,7 @@ enable_mature()
> >  	# Sync before enabling squotas to reliably *not* count the writes
> >  	# we did before enabling.
> >  	sync
> > -	enable_quota "s"
> > +	$BTRFS_UTIL_PROG quota enable --simple $SCRATCH_MNT
> 
> This change doesn't seem related to patch 2/2. I think we can review
> these 2 patches separately.
> 
> For this patch, I'm fine with or without it. If the btrfs list prefers
> to have it, or move it to be a common helper, I'm good with that.
> 
> Thanks,
> Zorro
> 

I pulled this into a separate patch based on Filipe's feedback on the
old version I failed to get in. Agreed it doesn't need to be a series,
just felt related enough to send in a batch, due to the context.

Thanks for taking a look,
Boris

> >  	set_subvol_limit $subvid $limit
> >  	_scratch_cycle_mount
> >  	usage=$(get_subvol_usage $subvid)
> > -- 
> > 2.54.0
> > 
> > 

  reply	other threads:[~2026-05-15 21:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13  0:43 [PATCH 0/2] squota delete fstests Boris Burkov
2026-05-13  0:43 ` [PATCH 1/2] btrfs: inline enable_quota helper in test 301 Boris Burkov
2026-05-14  3:34   ` Zorro Lang
2026-05-15 21:15     ` Boris Burkov [this message]
2026-05-13  0:43 ` [PATCH 2/2] btrfs: test qgroup deletion races with squota writes Boris Burkov

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=20260515211549.GA3470939@zen.localdomain \
    --to=boris@bur.io \
    --cc=fstests@vger.kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@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