]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs/253: update the data chunk size to the correct one
authorQu Wenruo <wqu@suse.com>
Thu, 22 Sep 2022 09:41:23 +0000 (17:41 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 23 Sep 2022 01:15:28 +0000 (09:15 +0800)
commit42cc53859ca1198c97a2ca88d4b6589592cfa50c
treedca4eb7f2c0b894485d88d1347bba472dec47fe8
parentce77f0422ae87716982cc9ad1c4019fc219af1da
btrfs/253: update the data chunk size to the correct one

[BUG]
After kernel commit 5da431b71d4b ("btrfs: fix the max chunk size and
stripe length calculation") the test case btrfs/253 will always fail.

[CAUSE]
Btrfs calculates the to-be-allocated chunk size using both
chunk and stripe size limits.

By default data chunk is limited to 10G, while data stripe size limit
is only 1G.
Thus the real chunk size limit would be:

  min(num_data_devices * max_stripe_size, max_chunk_size)

For single disk case (the test case), the value would be:

  min(        1        *       1G       ,       10G) = 1G.

The test case can only pass during a small window:

- Commit f6fca3917b4d ("btrfs: store chunk size in space-info struct")

  This changed the max chunk size limit to 1G, which would cause way
  more chunks for profiles like RAID0/10/5/6, thus it is considered as
  a regression.

- Commit 5da431b71d4b ("btrfs: fix the max chunk size and stripe length calculation")

  This is the fix for above regression, which reverts the data chunk
  limit back to 10G.

[FIX]
Fix the failure by introducing a hardcoded expected data chunk size (1G).

Since the test case has fixed fs size (10G) and is only utilizing one
disk, that 1G size will work for all possible data profiles (SINGLE and
DUP).

The more elegant solution is to export stripe size limit through sysfs
interfaces, but that would take at least 2 kernel cycles.

For now, just use a hotfix to make the test case work again.

Since we are here, also remove the leading "t" in the error message.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/253