public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH v2] fstests: btrfs: add a regression test for incorrect inode incompressible flag
Date: Mon, 9 Feb 2026 20:26:07 +1030	[thread overview]
Message-ID: <22b559fc-b3ec-4584-b19c-9f892ba9a32e@suse.com> (raw)
In-Reply-To: <CAL3q7H4_pRExfW6U67YfMK7hXouXspAXXJHPWM2t3yGC3AY0CQ@mail.gmail.com>



在 2026/2/9 20:24, Filipe Manana 写道:
> On Mon, Feb 9, 2026 at 9:50 AM Qu Wenruo <wqu@suse.com> wrote:
>>
>> [BUG]
>> Since kernel commit 59615e2c1f63 ("btrfs: reject single block sized
>> compression early"), a single block write at file offset 0, which can
>> not be inlined due the inode size, will mark the inode incompressible.
>>
>> [REGRESSION TEST]
>> The new regression test will do:
>>
>> - Create and mount the fs with compression,max_inline=2k
>>
>> - Do the following operations:
>>    * Truncate the inode to 2 * blocksize
>>      This will rule out any future inlined writes.
>>
>>    * Buffered write [0, 2K)
>>      Which will not be inlined.
>>
>>    * Sync
>>      For affected kernels, this will set the inode with NOCOMPRESS
>>      and reject all future compression on that inode.
>>
>>    * Buffered write [1M, 2M)
>>      For affected kernels, the range will not be compressed due
>>      to the NOCOMPRESS inode flag.
>>
>> - Unmount the fs
>>
>> - Make sure that:
>>    * The inode has no NOCOMPRESS flag
>>    * File extent at file offset 1M is being compressed
>>
>> Reviewed-by: Filipe Manana <fdmanana@suse.com>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>> ---
>> Changelog:
>> v2:
>> - Remove an unnessary sentence
>>    Which is confusing because I missed the "and" to connect the two
>>    sentences, and it's not needed after the first paragraph anyway.
>>
>> - Use full "btrfs inspect-internal" group name instead
>>
>> - Add missing punctures
>> ---
>>   tests/btrfs/343     | 47 +++++++++++++++++++++++++++++++++++++++++++++
>>   tests/btrfs/343.out |  2 ++
>>   2 files changed, 49 insertions(+)
>>   create mode 100755 tests/btrfs/343
>>   create mode 100644 tests/btrfs/343.out
>>
>> diff --git a/tests/btrfs/343 b/tests/btrfs/343
>> new file mode 100755
>> index 00000000..78079eff
>> --- /dev/null
>> +++ b/tests/btrfs/343
>> @@ -0,0 +1,47 @@
>> +#! /bin/bash
>> +# SPDX-License-Identifier: GPL-2.0
>> +# Copyright (c) 2026 SUSE S.A.  All Rights Reserved.
>> +#
>> +# FS QA Test 343
>> +#
>> +# A regression test to make sure a single-block write at file offset 0 won't
>> +# incorrectly mark the inode incompressible.
>> +#
>> +. ./common/preamble
>> +_begin_fstest auto quick compress
>> +
>> +_require_scratch
> 
> Still missing a:
> 
> _require_btrfs_command inspect-internal dump-tree
> 
> As noted in the review of the first version.
> Otherwise it looks good, thanks.

Facepalm, I forgot to commit...

      reply	other threads:[~2026-02-09  9:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09  9:50 [PATCH v2] fstests: btrfs: add a regression test for incorrect inode incompressible flag Qu Wenruo
2026-02-09  9:54 ` Filipe Manana
2026-02-09  9:56   ` Qu Wenruo [this message]

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=22b559fc-b3ec-4584-b19c-9f892ba9a32e@suse.com \
    --to=wqu@suse.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