Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/8] btrfs-progs: zoned: proper "mkfs.btrfs -b" support
@ 2024-05-14 18:22 Naohiro Aota
  2024-05-14 18:22 ` [PATCH v2 1/8] btrfs-progs: rename block_count to byte_count Naohiro Aota
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Naohiro Aota @ 2024-05-14 18:22 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Naohiro Aota

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


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-05-15 21:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14 18:22 [PATCH v2 0/8] btrfs-progs: zoned: proper "mkfs.btrfs -b" support Naohiro Aota
2024-05-14 18:22 ` [PATCH v2 1/8] btrfs-progs: rename block_count to byte_count Naohiro Aota
2024-05-14 18:22 ` [PATCH v2 2/8] btrfs-progs: mkfs: remove duplicated device size check Naohiro Aota
2024-05-14 18:22 ` [PATCH v2 3/8] btrfs-progs: mkfs: unify zoned mode minimum size calc into btrfs_min_dev_size() Naohiro Aota
2024-05-14 18:22 ` [PATCH v2 4/8] btrfs-progs: mkfs: fix minimum size calculation for zoned mode Naohiro Aota
2024-05-14 22:54   ` Qu Wenruo
2024-05-15 16:25     ` Naohiro Aota
2024-05-14 18:22 ` [PATCH v2 5/8] btrfs-progs: mkfs: check if byte_count is zone size aligned Naohiro Aota
2024-05-14 22:56   ` Qu Wenruo
2024-05-15 15:43     ` Naohiro Aota
2024-05-14 18:22 ` [PATCH v2 6/8] btrfs-progs: support byte length for zone resetting Naohiro Aota
2024-05-14 22:59   ` Qu Wenruo
2024-05-15 16:11     ` Naohiro Aota
2024-05-15 21:47       ` Qu Wenruo
2024-05-14 18:22 ` [PATCH v2 7/8] btrfs-progs: add test " Naohiro Aota
2024-05-14 23:04   ` Qu Wenruo
2024-05-15 16:14     ` Naohiro Aota
2024-05-14 18:22 ` [PATCH v2 8/8] btrfs-progs: test: use smaller emulated zone size Naohiro Aota

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox