FS/XFS testing framework
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: zlang@kernel.org, fstests@vger.kernel.org,
	linux-btrfs@vger.kernel.org, Zorro Lang <zlang@redhat.com>
Subject: Re: [PATCH] fstests: btrfs/226: fill in missing comments changes
Date: Mon, 24 Feb 2025 06:30:04 +0800	[thread overview]
Message-ID: <86a1ea5e-b0cc-4f6f-b578-9fa0512ff7fb@oracle.com> (raw)
In-Reply-To: <CAL3q7H6cAGE4C5vRw60P1iu1zoA=JnK3+rNMbiN8CXiMT3C02g@mail.gmail.com>



On 22/2/25 19:29, Filipe Manana wrote:
> On Sat, Feb 22, 2025 at 11:17 AM Anand Jain <anand.jain@oracle.com> wrote:
>>
>>
>>
>> On 21/2/25 23:03, Zorro Lang wrote:
>>> On Fri, Feb 21, 2025 at 12:04:32PM +0000, Filipe Manana wrote:
>>>> On Tue, Feb 18, 2025 at 10:36 PM Anand Jain <anand.jain@oracle.com> wrote:
>>>>>
>>>>> From: Qu Wenruo <wqu@suse.com>
>>>>>
>>>>> Update comments that were previously missed.
>>>>>
>>>>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>>>>> ---
>>>>>    tests/btrfs/226 | 6 ++----
>>>>>    1 file changed, 2 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/tests/btrfs/226 b/tests/btrfs/226
>>>>> index 359813c4f394..ce53b7d48c49 100755
>>>>> --- a/tests/btrfs/226
>>>>> +++ b/tests/btrfs/226
>>>>> @@ -22,10 +22,8 @@ _require_xfs_io_command fpunch
>>>>>
>>>>>    _scratch_mkfs >>$seqres.full 2>&1
>>>>>
>>>>> -# This test involves RWF_NOWAIT direct IOs, but for inodes with data checksum,
>>>>> -# btrfs will fall back to buffered IO unconditionally to prevent data checksum
>>>>> -# mimsatch, and that will break RWF_NOWAIT with -EAGAIN.
>>>>> -# So here we have to go with nodatasum mount option.
>>>>> +# RWF_NOWAIT works only with direct I/O and requires an inode with nodatasum
>>>>> +# to avoid checksum mismatches. Otherwise, it falls back to buffered I/O.
>>>>
>>>> Btw, this is different from what I suggested before here:
>>>>
>>>> https://lore.kernel.org/fstests/68aa436b-4ddd-4ee7-ad5a-8eca55aae176@oracle.com/T/#mb2369802d2e33c9778c62fcb3c0ee47de28b773b
>>>>
>>>> Which is:
>>>>
>>>> # RWF_NOWAIT only works with direct IO, which requires an inode with
>>>> nodatasum (otherwise it falls back to buffered IO).
>>>>
>>>> What is being added in this patch:
>>>>
>>>> +# RWF_NOWAIT works only with direct I/O and requires an inode with nodatasum
>>>> +# to avoid checksum mismatches. Otherwise, it falls back to buffered I/O.
>>>>
>>>> Is confusing because:
>>>>
>>>> 1) It gives the suggestion RWF_NOWAIT requires nodatasum.
>>>>
>>>> 2) The part that says "to avoid checksum mismatches", that's not
>>>> related to RWF_NOWAIT at all.
>>>>       That's the reason why direct IO writes against inodes without
>>>> nodatasum fallback to buffered IO.
>>>>       We don't have to explain that - this is not a test to exercise the
>>>> fallback after all, all we have to say
>>>>       is that RWF_NOWAIT needs direct IO and direct IO can only be done
>>>> against inodes with nodatasum.
>>>>
>>>> So you didn't pick my suggestion after all, you just added your own
>>>> rephrasing which IMO is confusing.
>>>
>>
>> Your sentence missed the consequence part (checksum mismatches) that
>> Qu's sentence included.
> 
> And that's totally irrelevant to this test case.
> 
> Preventing checksum mismatches is why direct IO writes fallback to
> buffered IO if the inode doesn't have the nodatasum flag - it has
> nothing to do with RWF_NOWAIT writes.
> Besides that, such mismatches only happen for cases where an app
> writes to the write buffer while the direct IO write is in progress -
> which is not the case of this test case.
> 
>>
>> How about,
>>
>> # RWF_NOWAIT only works with direct IO, which requires an inode with
>> nodatasum to avoid checksum-mismatches (otherwise it falls back to
>> buffered IO).
> 
> Just stick it to the original - simple and to the point.
> 
> Thanks.

Done. Thx.
Anand

> 
>>
>> Thx, Anand
>>
>>> Hi Anand, please talk with Filipe (or more btrfs folks) and make a final
>>> decision about how to write this comment. I'll drop this patch from
>>> patches-in-queue branch temporarily, until you reach a consensus :)
>>>
>>> Thanks,
>>> Zorro
>>>
>>>>
>>>>
>>>>
>>>>>    _scratch_mount -o nodatasum
>>>>>
>>>>>    # Test a write against COW file/extent - should fail with -EAGAIN. Disable the
>>>>> --
>>>>> 2.47.0
>>>>>
>>>>>
>>>>
>>>
>>


  reply	other threads:[~2025-02-23 22:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-18 22:35 [PATCH] fstests: btrfs/226: fill in missing comments changes Anand Jain
2025-02-19  5:58 ` Zorro Lang
2025-02-21 12:04 ` Filipe Manana
2025-02-21 15:03   ` Zorro Lang
2025-02-22 11:16     ` Anand Jain
2025-02-22 11:29       ` Filipe Manana
2025-02-23 22:30         ` Anand Jain [this message]
2025-02-23 22:31     ` Anand Jain
2025-02-23 22:30   ` [PATCH v2] " Anand Jain

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=86a1ea5e-b0cc-4f6f-b578-9fa0512ff7fb@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=fdmanana@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zlang@kernel.org \
    --cc=zlang@redhat.com \
    /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