public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: fstests <fstests@vger.kernel.org>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] btrfs: test log replay after fsync of file with prealloc extents beyond eof
Date: Thu, 24 Feb 2022 13:21:28 +1100	[thread overview]
Message-ID: <20220224022128.GK3061737@dread.disaster.area> (raw)
In-Reply-To: <CAL3q7H41wY_GWStRUxuOWwPcgqX9zx-WZxEySaRAUrMtcE666w@mail.gmail.com>

On Wed, Feb 23, 2022 at 12:12:10PM +0000, Filipe Manana wrote:
> On Tue, Feb 22, 2022 at 11:44 PM Dave Chinner <david@fromorbit.com> wrote:
> >
> > On Thu, Feb 17, 2022 at 12:14:21PM +0000, fdmanana@kernel.org wrote:
> > > From: Filipe Manana <fdmanana@suse.com>
> > >
> > > Test that after a full fsync of a file with preallocated extents beyond
> > > the file's size, if a power failure happens, the preallocated extents
> > > still exist after we mount the filesystem.
> > >
> > > This test currently fails and there is a patch for btrfs that fixes this
> > > issue and has the following subject:
> > >
> > >   "btrfs: fix lost prealloc extents beyond eof after full fsync"
> > >
> > > Signed-off-by: Filipe Manana <fdmanana@suse.com>
> > > ---
> > >  tests/btrfs/261     | 79 +++++++++++++++++++++++++++++++++++++++++++++
> > >  tests/btrfs/261.out | 10 ++++++
> >
> > What is btrfs specific about this test?
> 
> The comments that explain the steps are very btrfs specific.
> Without them it would be hard to understand why the test uses that
> specific file size, block size, mention of the btrfs inode's full sync
> bit, etc.

But the behaviour and layout should end up being the same for all
filesystems, right?

We have plenty of generic tests that are designed with a
specific configuration on a specific filesystem to reproduce a bug
seen on that filesystem, but as long as all filesystems should be
expected to behave the same way, it's a generic test.

AFAICT, the behaviour described and exercised by the test should be
the same for all filesystems that support preallocation beyond EOF.
Hence it isn't btrfs specific behaviour being exercised, just a
reproducing a bug where btrfs deviates from the correct behaviour
that should be consistent across all filesystems.

> Some years ago, when you maintained fstests, you complained once about
> this type of "too btrfs specific" comments on generic tests.

I can change my mind if I want. Besides, I'm looking at this new
test purely on it's own merits so past discussions aren't really
relevant. Maybe you didn't understand the context under which I was
considering a patch to be "too fs specific" rather than generic.

There's a big difference between "only btrfs will behave this way"
and "all filesystems should get the same result, but btrfs sometimes
fails to get that results in this specific case".  The former should
be a btrfs-only test, the latter should be a generic test.

Which class this test falls into is exactly what I'm asking here -
should all filesystems get the same result, or is successful
result encoded in the golden output behaviour that only btrfs will
ever produce?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2022-02-24  2:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 12:14 [PATCH] btrfs: test log replay after fsync of file with prealloc extents beyond eof fdmanana
2022-02-22 23:44 ` Dave Chinner
2022-02-23 12:12   ` Filipe Manana
2022-02-24  2:21     ` Dave Chinner [this message]
2022-03-02 11:33       ` Filipe Manana

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=20220224022128.GK3061737@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --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