All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Harmstone <maharmstone@meta.com>
To: Filipe Manana <fdmanana@kernel.org>,
	Mark Harmstone <maharmstone@meta.com>,
	"zlang@kernel.org" <zlang@kernel.org>
Cc: "fstests@vger.kernel.org" <fstests@vger.kernel.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] generic: add test for missing btrfs csums in log when doing async on subpage vol
Date: Fri, 18 Oct 2024 17:36:26 +0000	[thread overview]
Message-ID: <d94875db-0bed-4077-a2e7-915e7358c1db@meta.com> (raw)
In-Reply-To: <CAL3q7H4wLLTLi_sfKEQB8qsQ6G7VxWBfK_4FwSi4qL5Z3bkycQ@mail.gmail.com>

On 16/10/24 12:09, Filipe Manana wrote:
> > 
> On Tue, Oct 15, 2024 at 4:42 PM Mark Harmstone <maharmstone@fb.com> wrote:
>>
>> Adds a test for a bug we encountered on Linux 6.4 on aarch64, where a
>> race could mean that csums weren't getting written to the log tree,
>> leading to corruption when it was replayed.
>>
>> The patches to detect log this tree corruption are in btrfs-progs 6.11.
> 
> This shouldn't be needed right?
> Because after log replay the csums are missing and 'btrfs check'
> detects (IIRC) missing csums for extents referred by file extent items
> in a subvolume tree - if it doesn't then it should be improved.

Yes, but we're not mounting it in the tests between the log_writes 
calls, so the log isn't getting replayed. The patches to btrfs check 
make it so that it identifies filesystems that would get corrupted as 
soon as they're next mounted.

> 
>>
>> Signed-off-by: Mark Harmstone <maharmstone@fb.com>
>> ---
>> This is a genericized version of the test I originally proposed as
>> btrfs/333.
>>
>>   tests/generic/757     | 71 +++++++++++++++++++++++++++++++++++++++++++
>>   tests/generic/757.out |  2 ++
>>   2 files changed, 73 insertions(+)
>>   create mode 100755 tests/generic/757
>>   create mode 100644 tests/generic/757.out
>>
>> diff --git a/tests/generic/757 b/tests/generic/757
>> new file mode 100755
>> index 00000000..6ad3d01e
>> --- /dev/null
>> +++ b/tests/generic/757
>> @@ -0,0 +1,71 @@
>> +#! /bin/bash
>> +# SPDX-License-Identifier: GPL-2.0
>> +#
>> +# FS QA Test 757
>> +#
>> +# Test async dio with fsync to test a btrfs bug where a race meant that csums
>> +# weren't getting written to the log tree, causing corruptions on remount.
>> +# This can be seen on subpage FSes on Linux 6.4.
>> +#
>> +. ./common/preamble
>> +_begin_fstest auto quick metadata log recoveryloop
>> +
>> +_fixed_by_kernel_commit e917ff56c8e7 \
>> +       "btrfs: determine synchronous writers from bio or writeback control"
> 
> For generic tests what we do is:
> 
> [ $FSTYP == "btrfs" ] && _fixed_by_kernel_commit .....
> 
> As long as the failure has not been observed and fixed on other filesystems.
> In case one day a regression happens in another fs, we just add a
> corresponding line using the same logic.
> 
> Otherwise if the test one days fails on another fs and fstests
> suggests that that commit is missing, it would be odd.
> 
> Everything else looks good, so with that fixed (maybe Zorro can change
> that when picking the patch):
> 
> Reviewed-by: Filipe Manana <fdmanana@suse.com>
> 
> Thanks.
> 

Thanks Filipe. Zorro, let me know if you're happy making this change, or 
otherwise I'll resubmit.

Mark


  reply	other threads:[~2024-10-18 17:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 15:39 [PATCH] generic: add test for missing btrfs csums in log when doing async on subpage vol Mark Harmstone
2024-10-16 11:09 ` Filipe Manana
2024-10-18 17:36   ` Mark Harmstone [this message]
2024-10-23  3:31     ` Zorro Lang
2024-10-23  3:43 ` Zorro Lang
2024-10-23  3:53 ` Zorro Lang
2024-10-23 10:34   ` Mark Harmstone
2024-10-28 21:57 ` Darrick J. Wong
2024-10-29  5:11   ` Zorro Lang
2024-10-29 10:03     ` Mark Harmstone

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=d94875db-0bed-4077-a2e7-915e7358c1db@meta.com \
    --to=maharmstone@meta.com \
    --cc=fdmanana@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zlang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.