public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, ritesh.list@gmail.com,
	ojaswin@linux.ibm.com, djwong@kernel.org, zlang@kernel.org,
	fdmanana@kernel.org, nirjhar.roy.lists@gmail.com
Subject: [PATCH 6/7] btrfs/301: Make this test compatible with all block sizes.
Date: Tue, 29 Jul 2025 06:21:49 +0000	[thread overview]
Message-ID: <a8233808db2ee1d7c5fe7ee8710388bb0cb8f787.1753769382.git.nirjhar.roy.lists@gmail.com> (raw)
In-Reply-To: <cover.1753769382.git.nirjhar.roy.lists@gmail.com>

With large block sizes like 64k on powerpc with 64k pagesize
the test failed with the following logs:

     QA output created by 301
     basic accounting
    +subvol 256 mismatched usage 33947648 vs 4587520 \
         (expected data 4194304 expected meta 393216 diff 29360128)
    +subvol 256 mismatched usage 168165376 vs 138805248 \
	(expected data 138412032 expected meta 393216 diff 29360128)
    +subvol 256 mismatched usage 33947648 vs 4587520 \
	(expected data 4194304 expected meta 393216 diff 29360128)
    +subvol 256 mismatched usage 33947648 vs 4587520 \
	(expected data 4194304 expected meta 393216 diff 29360128)
     fallocate: Disk quota exceeded
(Please note that the above ouptut had to be modified a bit since
the number of characters in each line was much greater than the
72 characters.)

The test creates nr_fill files each of size 8k i.e, 2x4k(stored in fill_sz).
Now with 64k blocksize, 8k sized files occupy more than expected
sizes (i.e, 8k) due to internal fragmentation since 1 file
will occupy at least 1 block. Fix this by scaling the file size (fill_sz)
with the blocksize.

Reported-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
 tests/btrfs/301 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/btrfs/301 b/tests/btrfs/301
index 6b59749d..7547ff0e 100755
--- a/tests/btrfs/301
+++ b/tests/btrfs/301
@@ -23,7 +23,13 @@ subv=$SCRATCH_MNT/subv
 nested=$SCRATCH_MNT/subv/nested
 snap=$SCRATCH_MNT/snap
 nr_fill=512
-fill_sz=$((8 * 1024))
+
+_scratch_mkfs >> $seqres.full
+_scratch_mount
+blksz=`_get_block_size $SCRATCH_MNT`
+_scratch_unmount
+fill_sz=$(( 2 * blksz ))
+
 total_fill=$(($nr_fill * $fill_sz))
 nodesize=$($BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | \
 					grep nodesize | $AWK_PROG '{print $2}')
-- 
2.34.1


  parent reply	other threads:[~2025-07-29  6:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29  6:21 [PATCH 0/7] btrfs: Misc test fixes for large block/node sizes Nirjhar Roy (IBM)
2025-07-29  6:21 ` [PATCH 1/7] common/filter: Add a helper function to filter offsets and sizes Nirjhar Roy (IBM)
2025-07-29  6:21 ` [PATCH 2/7] common/btrfs: Add a helper function to get the nodesize Nirjhar Roy (IBM)
2025-07-29  6:21 ` [PATCH 3/7] btrfs/137: Make this compatible with all block sizes Nirjhar Roy (IBM)
2025-08-04  3:58   ` Qu Wenruo
2025-08-05  9:41     ` Ojaswin Mujoo
2025-08-05  9:44       ` Qu Wenruo
2025-08-05 12:39         ` Ojaswin Mujoo
2025-08-05 10:47       ` Filipe Manana
2025-08-12  6:23         ` Nirjhar Roy (IBM)
2025-08-12  6:22     ` Nirjhar Roy (IBM)
2025-07-29  6:21 ` [PATCH 4/7] btrfs/200: Make this test scale with the block size Nirjhar Roy (IBM)
2025-07-29  6:53   ` Filipe Manana
2025-08-12  6:26     ` Nirjhar Roy (IBM)
2025-08-04  4:19   ` Qu Wenruo
2025-07-29  6:21 ` [PATCH 5/7] generic/563: Increase the write tolerance to 6% for larger nodesize Nirjhar Roy (IBM)
2025-07-29  7:45   ` Christoph Hellwig
2025-08-04  7:18     ` Nirjhar Roy (IBM)
2025-07-30 15:06   ` Filipe Manana
2025-08-04  7:18     ` Nirjhar Roy (IBM)
2025-08-04  4:28   ` Qu Wenruo
2025-08-12  6:27     ` Nirjhar Roy (IBM)
2025-07-29  6:21 ` Nirjhar Roy (IBM) [this message]
2025-08-04  4:32   ` [PATCH 6/7] btrfs/301: Make this test compatible with all block sizes Qu Wenruo
2025-08-12  6:30     ` Nirjhar Roy (IBM)
2025-07-29  6:21 ` [PATCH 7/7] generic/274: Make the test compatible with all blocksizes Nirjhar Roy (IBM)
2025-08-04  4:35   ` Qu Wenruo
2025-08-12  6:30     ` 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=a8233808db2ee1d7c5fe7ee8710388bb0cb8f787.1753769382.git.nirjhar.roy.lists@gmail.com \
    --to=nirjhar.roy.lists@gmail.com \
    --cc=djwong@kernel.org \
    --cc=fdmanana@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox