From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org, ritesh.list@gmail.com,
ojaswin@linux.ibm.com, djwong@kernel.org, fdmanana@kernel.org,
quwenruo.btrfs@gmx.com, zlang@kernel.org
Subject: Re: [PATCH 1/4] generic/371: Fix the test to be compatible block sizes upto 64k
Date: Mon, 3 Nov 2025 21:15:40 +0530 [thread overview]
Message-ID: <953a01c5-4ae4-4350-aecc-e1daf14ce307@gmail.com> (raw)
In-Reply-To: <20251101113625.zyq4gsf6d63q6dti@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>
On 11/1/25 17:06, Zorro Lang wrote:
> On Tue, Oct 21, 2025 at 02:27:46PM +0530, Nirjhar Roy (IBM) wrote:
>> On 9/26/25 22:07, Zorro Lang wrote:
>>> On Tue, Sep 16, 2025 at 03:30:09PM +0000, Nirjhar Roy (IBM) wrote:
>>>> When this test was ran with btrfs with 64k sector/block size, it
>>>> failed with
>>>>
>>>> QA output created by 371
>>>> Silence is golden
>>>> +fallocate: No space left on device
>>>> +pwrite: No space left on device
>>>> +fallocate: No space left on device
>>>> +pwrite: No space left on device
>>>> +pwrite: No space left on device
>>>> ...
>>>>
>>>> This is what is going on:
>>>>
>>>> Let us see the following set of operations:
>>>>
>>>> --- With 4k sector size ---
>>>> $ mkfs.btrfs -f -b 256m -s 4k -n 4k /dev/loop0
>>>> $ mount /dev/loop0 /mnt1/scratch/
>>>> $ df -h /dev/loop0
>>>> Filesystem Size Used Avail Use% Mounted on
>>>> /dev/loop0 256M 1.5M 175M 1% /mnt1/scratch
>>>>
>>>> $ xfs_io -f -c "pwrite 0 80M" /mnt1/scratch/t1
>>>> wrote 83886080/83886080 bytes at offset 0
>>>> 80 MiB, 20480 ops; 0.4378 sec (182.693 MiB/sec and 46769.3095 ops/sec)
>>>>
>>>> $ df -h /dev/loop0
>>>> Filesystem Size Used Avail Use% Mounted on
>>>> /dev/loop0 256M 1.5M 175M 1% /mnt1/scratch
>>>>
>>>> $ sync
>>>> $ df -h /dev/loop0
>>>> Filesystem Size Used Avail Use% Mounted on
>>>> /dev/loop0 256M 82M 95M 47% /mnt1/scratch
>>>>
>>>> $ xfs_io -f -c "pwrite 0 80M" /mnt1/scratch/t2
>>>> wrote 83886080/83886080 bytes at offset 0
>>>> 80 MiB, 20480 ops; 0:00:01.25 (63.881 MiB/sec and 16353.4648 ops/sec)
>>>>
>>>> $ df -h /dev/loop0
>>>> Filesystem Size Used Avail Use% Mounted on
>>>> /dev/loop0 256M 137M 40M 78% /mnt1/scratch
>>>>
>>>> $ sync
>>>> $ df -h /dev/loop0
>>>> Filesystem Size Used Avail Use% Mounted on
>>>> /dev/loop0 256M 162M 15M 92% /mnt1/scratch
>>>>
>>>> Now let us repeat with 64k sector size
>>>> --- With 64k sector size ---
>>>> $ mkfs.btrfs -f -b 256m -s 64k -n 64k /dev/loop0
>>>> $ mount /dev/loop0 /mnt1/scratch/
>>>> $ df -h /dev/loop0
>>>> Filesystem Size Used Avail Use% Mounted on
>>>> /dev/loop0 256M 24M 175M 12% /mnt1/scratch
>>>>
>>>> $ xfs_io -f -c "pwrite 0 80M" /mnt1/scratch/t1
>>>> wrote 83886080/83886080 bytes at offset 0
>>>> 80 MiB, 20480 ops; 0.8460 sec (94.553 MiB/sec and 24205.4914 ops/sec)
>>>> $
>>>> $ df -h /dev/loop0
>>>> Filesystem Size Used Avail Use% Mounted on
>>>> /dev/loop0 256M 24M 175M 12% /mnt1/scratch
>>>>
>>>> $ sync
>>>> $ df -h /dev/loop0
>>>> Filesystem Size Used Avail Use% Mounted on
>>>> /dev/loop0 256M 104M 95M 53% /mnt1/scratch
>>>>
>>>> $ xfs_io -f -c "pwrite 0 80M" /mnt1/scratch/t2
>>>> pwrite: No space left on device
>>>>
>>>> Now, we can see that with 64k node size, 256M is not sufficient
>>>> to hold 2 files worth 80M. For 64k, we can also see that the initial
>>>> space usage on a fresh filesystem is 24M and for 4k its 1.5M. So
>>>> because of higher node size, more metadata space is getting used.
>>>> This test requires the size of the filesystem to be at least capable
>>>> to hold 2 80M files.
>>>> Fix this by increasing the fs size from 256M to 330M.
>>> Thanks for this detailed explanation. As this's a ENOSPC test, so we
>>> must make sure this case still can uncover the original bug, before
>>> increasing the fs size. Can you make sure that? Or maybe we can replace
>>> that "80M" with a variable (according to "Avail" size).
>> Hi Filipe, Zorro, Wang,
>>
>> The original commit message of generic/371 says that this test catches some
>> excess space usage issues. Is(Are) there any patch(es) that fix this issue -
>> so that I can remove the commits and check if the test expectedly fails with
>> slightly large fssize i.e, 330M?
>>
>> I did find some related commits [1] and I ran the test with 330M and
>> 256M(the default size) after removing the commits[1] but the test passes
>> with both the filesystem sizes. So I am guessing, this is not the patch that
>> can test generic/371.
>>
>> [1] https://lore.kernel.org/linux-btrfs/cover.1610747242.git.josef@toxicpanda.com/
> Hi,
>
> I'm not familiar with btrfs patches, but from the commit history, I suspect
> it *might* be related with below commit:
>
> commit 18513091af9483ba84328d42092bd4d42a3c958f
> Author: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
> Date: Mon Jul 25 15:51:40 2016 +0800
>
> btrfs: update btrfs_space_info's bytes_may_use timely
>
> Or "c0d2f6104e8ab2eb75e58e72494ad4b69c5227f8" :)
Thank you for the pointers. I tried running the test by checking out the
commits before the above 2 mentioned commits, but the test seems to pass
with the existing fs size.
--NR
>
> Thanks,
> Zorro
>
>> --NR
>>
>>> Thanks,
>>> Zorro
>>>
>>>> Reported-by: Disha Goel <disgoel@linux.ibm.com>
>>>> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
>>>> ---
>>>> tests/generic/371 | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/tests/generic/371 b/tests/generic/371
>>>> index b312c450..95af308e 100755
>>>> --- a/tests/generic/371
>>>> +++ b/tests/generic/371
>>>> @@ -19,7 +19,7 @@ _require_scratch
>>>> _require_xfs_io_command "falloc"
>>>> test "$FSTYP" = "xfs" && _require_xfs_io_command "extsize"
>>>> -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1
>>>> +_scratch_mkfs_sized $((330 * 1024 * 1024)) >> $seqres.full 2>&1
>>>> _scratch_mount
>>>> # Disable speculative post-EOF preallocation on XFS, which can grow fast enough
>>>> --
>>>> 2.34.1
>>>>
>> --
>> Nirjhar Roy
>> Linux Kernel Developer
>> IBM, Bangalore
>>
--
Nirjhar Roy
Linux Kernel Developer
IBM, Bangalore
next prev parent reply other threads:[~2025-11-03 15:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-16 15:30 [PATCH 0/4] btrfs: More test fixes for large block/node sizes Nirjhar Roy (IBM)
2025-09-16 15:30 ` [PATCH 1/4] generic/371: Fix the test to be compatible block sizes upto 64k Nirjhar Roy (IBM)
2025-09-26 16:37 ` Zorro Lang
2025-10-21 8:57 ` Nirjhar Roy (IBM)
2025-11-01 11:36 ` Zorro Lang
2025-11-03 15:44 ` Nirjhar Roy (IBM)
2025-11-03 15:45 ` Nirjhar Roy (IBM) [this message]
2025-12-15 5:04 ` Nirjhar Roy (IBM)
2026-01-18 18:22 ` Zorro Lang
2026-01-19 5:11 ` Nirjhar Roy (IBM)
2025-10-21 9:00 ` Nirjhar Roy (IBM)
2026-01-21 13:51 ` Zorro Lang
2025-09-16 15:30 ` [PATCH 2/4] generic/562: Make test compatible with block sizes till 64k Nirjhar Roy (IBM)
2025-09-26 16:54 ` Zorro Lang
2025-10-07 8:29 ` Nirjhar Roy (IBM)
2025-10-07 11:18 ` Filipe Manana
2025-10-07 11:22 ` Nirjhar Roy (IBM)
2025-09-16 15:30 ` [PATCH 3/4] btrfs/200: Make the test compatible with all supported block sizes Nirjhar Roy (IBM)
2025-09-26 17:38 ` Zorro Lang
2025-10-07 8:28 ` Nirjhar Roy (IBM)
2025-10-07 11:19 ` Filipe Manana
2025-09-16 15:30 ` [PATCH 4/4] btrfs/290: " Nirjhar Roy (IBM)
2025-10-07 11:22 ` Filipe Manana
2025-10-07 11:27 ` Nirjhar Roy (IBM)
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=953a01c5-4ae4-4350-aecc-e1daf14ce307@gmail.com \
--to=nirjhar.roy.lists@gmail.com \
--cc=djwong@kernel.org \
--cc=fdmanana@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=quwenruo.btrfs@gmx.com \
--cc=ritesh.list@gmail.com \
--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 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.