mbox series

[v2,0/8] btrfs-progs: zoned: proper "mkfs.btrfs -b" support

Message ID 20240514182227.1197664-1-naohiro.aota@wdc.com (mailing list archive)
Headers show
Series btrfs-progs: zoned: proper "mkfs.btrfs -b" support | expand

Message

Naohiro Aota May 14, 2024, 6:22 p.m. UTC
mkfs.btrfs -b <byte_count> on a zoned device has several issues listed
below.

- The FS size needs to be larger than minimal size that can host a btrfs,
  but its calculation does not consider non-SINGLE profile
- The calculation also does not ensure tree-log BG and data relocation BG
- It allows creating a FS not aligned to the zone boundary
- It resets all device zones beyond the specified length

This series fixes the issues with some cleanups.

This one passed CI workflow here:
https://github.com/naota/btrfs-progs/actions/runs/9083915553

Patches 1 to 3 are clean up patches, so they should not change the behavior.

Patches 4 to 6 address the issues.

The last two patches handle the test cases. Patch 7 adds a new test for
zone resetting. And, patch 8 tweaks an existing test to use smaller zone
size to have enough zones than the new requirement.

Changes:
- v2
  - fix function declaration on older distro (non-ZONED setup)
  - fix mkfs test failure

Naohiro Aota (8):
  btrfs-progs: rename block_count to byte_count
  btrfs-progs: mkfs: remove duplicated device size check
  btrfs-progs: mkfs: unify zoned mode minimum size calc into
    btrfs_min_dev_size()
  btrfs-progs: mkfs: fix minimum size calculation for zoned mode
  btrfs-progs: mkfs: check if byte_count is zone size aligned
  btrfs-progs: support byte length for zone resetting
  btrfs-progs: add test for zone resetting
  btrfs-progs: test: use smaller emulated zone size

 .github/workflows/coverage.yml           |  2 +-
 .github/workflows/devel.yml              |  2 +-
 .github/workflows/pull-request.yml       |  2 +-
 common/device-utils.c                    | 45 +++++++------
 kernel-shared/zoned.c                    | 23 ++++++-
 kernel-shared/zoned.h                    |  7 +-
 mkfs/common.c                            | 48 +++++++++++++-
 mkfs/common.h                            |  2 +-
 mkfs/main.c                              | 82 ++++++++++--------------
 tests/mkfs-tests/030-zoned-rst/test.sh   |  7 +-
 tests/mkfs-tests/032-zoned-reset/test.sh | 62 ++++++++++++++++++
 11 files changed, 202 insertions(+), 80 deletions(-)
 create mode 100755 tests/mkfs-tests/032-zoned-reset/test.sh

--
2.45.0