linux-bcachefs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Overstreet <kent.overstreet@gmail.com>
To: Eryu Guan <guan@eryu.me>
Cc: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-bcachefs@vger.kernel.org
Subject: Re: [PATCH v2 3/4] generic/{455,457,482}: make dmlogwrites tests work on bcachefs
Date: Tue, 1 Jun 2021 14:50:28 -0400	[thread overview]
Message-ID: <YLaBdAxSrK0s4xEP@moria.home.lan> (raw)
In-Reply-To: <YLOQuagLB3LhKPOl@desktop>

On Sun, May 30, 2021 at 09:18:49PM +0800, Eryu Guan wrote:
> On Tue, May 25, 2021 at 06:19:54PM -0400, Kent Overstreet wrote:
> > bcachefs has log structured btree nodes, in addition to a regular
> > journal, which means that unless we replay to markers in the log in the
> > same order that they happened and are careful to avoid writing in
> > between replaying to different events - we need to wipe and start fresh
> > each time.
> > 
> > Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
> > ---
> >  tests/generic/455 | 14 ++++++++++++++
> >  tests/generic/457 | 14 ++++++++++++++
> >  tests/generic/482 | 27 ++++++++++++++++++++-------
> >  3 files changed, 48 insertions(+), 7 deletions(-)
> > 
> > diff --git a/tests/generic/455 b/tests/generic/455
> > index 5b4b242e74..6dc46c3c72 100755
> > --- a/tests/generic/455
> > +++ b/tests/generic/455
> > @@ -35,6 +35,17 @@ _require_dm_target thin-pool
> >  
> >  rm -f $seqres.full
> >  
> > +_reset_dmthin()
> > +{
> > +    # With bcachefs, we need to wipe and start fresh every time we replay to a
> > +    # different point in time - if we see metadata from a future point in time,
> > +    # or an unrelated mount, bcachefs will get confused:
> > +    if [ "$FSTYP" = "bcachefs" ]; then
> > +	_dmthin_cleanup
> > +	_dmthin_init $devsize $devsize $csize $lowspace
> > +    fi
> > +}
> 
> I think we probably could make it a common helper, and currently only
> bcachefs needs reset, and more log structured filesystems may be
> supported in the future.

I think it might be better to wait until we have more dmlogwrites tests or
another filesystem that needs this - I don't think this would be a good common
helper as is, it's too coupled to what the tests are doing - factoring out
helpers just because you spot identical code is an anti pattern when there isn't
a good notion of what you're abstracting

Right now 455 and 457 are basically identical anyways, factoring out a single
helper and ignoring the rest doesn't make much sense to me.

  reply	other threads:[~2021-06-01 18:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 22:19 [PATCH 1/4] Improved .gitignore Kent Overstreet
2021-05-25 22:19 ` [PATCH 2/4] Initial bcachefs support Kent Overstreet
2021-05-25 22:19 ` [PATCH 3/4] generic/{455,457,482}: make dmlogwrites tests work on bcachefs Kent Overstreet
2021-05-25 22:19 ` [PATCH 4/4] generic/269: add _check_scratch_fs Kent Overstreet
2021-05-25 22:19 ` [PATCH v2 1/4] Improved .gitignore Kent Overstreet
2021-05-25 22:19 ` [PATCH v2 2/4] Initial bcachefs support Kent Overstreet
2021-05-25 22:19 ` [PATCH v2 3/4] generic/{455,457,482}: make dmlogwrites tests work on bcachefs Kent Overstreet
2021-05-30 13:18   ` Eryu Guan
2021-06-01 18:50     ` Kent Overstreet [this message]
2021-05-25 22:19 ` [PATCH v2 4/4] generic/269: add _check_scratch_fs Kent Overstreet
2021-05-26  1:34   ` Darrick J. Wong
2021-05-26  1:53     ` Kent Overstreet

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=YLaBdAxSrK0s4xEP@moria.home.lan \
    --to=kent.overstreet@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-fsdevel@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).