Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH v4 00/10] btrfs-progs: zoned: proper "mkfs.btrfs -b" support
@ 2024-05-29  7:13 Naohiro Aota
  2024-05-29  7:13 ` [PATCH v4 01/10] btrfs-progs: rename block_count to byte_count Naohiro Aota
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Naohiro Aota @ 2024-05-29  7:13 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:

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

Patches 4 to 6 address the issues.

Patches 7 to 10 add/modify the test cases. First, patch 7 adds nullb
functions to use in later patches. Patch 8 adds a new test for
zone resetting. And, patches 9 and 10 rewrites existing tests with the
nullb helper.

Changes:
- v4:
  -  Fix source directory size alignment.
- v3: https://lore.kernel.org/linux-btrfs/dfd8887b-a2cb-425f-8705-0d6a94cefb9c@gmx.com/
  - Tweak minimum FS size calculation style.
  - Round down the specified byte_count towards sectorsize and zone
    size, instead of banning unaligned byte_count.
  - Add active zone description in the commit log of patch 6.
  - Add nullb test functions and use them in tests.
- v2: https://lore.kernel.org/linux-btrfs/20240514182227.1197664-1-naohiro.aota@wdc.com/
  - fix function declaration on older distro (non-ZONED setup)
  - fix mkfs test failure
- v1: https://lore.kernel.org/linux-btrfs/20240514005133.44786-1-naohiro.aota@wdc.com/

Naohiro Aota (10):
  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: align byte_count with sectorsize and zone size
  btrfs-progs: support byte length for zone resetting
  btrfs-progs: test: add nullb setup functions
  btrfs-progs: test: add test for zone resetting
  btrfs-progs: test: use nullb helper and smaller zone size
  btrfs-progs: test: use nullb helpers in 031-zoned-bgt

 common/device-utils.c                    | 45 +++++++-----
 kernel-shared/zoned.c                    | 23 +++++-
 kernel-shared/zoned.h                    |  7 +-
 mkfs/common.c                            | 62 ++++++++++++++---
 mkfs/common.h                            |  2 +-
 mkfs/main.c                              | 89 ++++++++++--------------
 tests/common                             | 63 +++++++++++++++++
 tests/mkfs-tests/030-zoned-rst/test.sh   | 14 ++--
 tests/mkfs-tests/031-zoned-bgt/test.sh   | 30 ++------
 tests/mkfs-tests/032-zoned-reset/test.sh | 43 ++++++++++++
 10 files changed, 260 insertions(+), 118 deletions(-)
 create mode 100755 tests/mkfs-tests/032-zoned-reset/test.sh

--
2.45.1


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

end of thread, other threads:[~2024-06-03 19:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29  7:13 [PATCH v4 00/10] btrfs-progs: zoned: proper "mkfs.btrfs -b" support Naohiro Aota
2024-05-29  7:13 ` [PATCH v4 01/10] btrfs-progs: rename block_count to byte_count Naohiro Aota
2024-05-29  7:13 ` [PATCH v4 02/10] btrfs-progs: mkfs: remove duplicated device size check Naohiro Aota
2024-05-29  7:13 ` [PATCH v4 03/10] btrfs-progs: mkfs: unify zoned mode minimum size calc into btrfs_min_dev_size() Naohiro Aota
2024-05-29  7:13 ` [PATCH v4 04/10] btrfs-progs: mkfs: fix minimum size calculation for zoned mode Naohiro Aota
2024-05-29  7:13 ` [PATCH v4 05/10] btrfs-progs: mkfs: align byte_count with sectorsize and zone size Naohiro Aota
2024-05-29  7:45   ` Qu Wenruo
2024-05-30 17:26     ` David Sterba
2024-05-29  7:13 ` [PATCH v4 06/10] btrfs-progs: support byte length for zone resetting Naohiro Aota
2024-06-03 19:26   ` David Sterba
2024-05-29  7:13 ` [PATCH v4 07/10] btrfs-progs: test: add nullb setup functions Naohiro Aota
2024-05-29  7:13 ` [PATCH v4 08/10] btrfs-progs: test: add test for zone resetting Naohiro Aota
2024-05-29  7:13 ` [PATCH v4 09/10] btrfs-progs: test: use nullb helper and smaller zone size Naohiro Aota
2024-05-29  7:13 ` [PATCH v4 10/10] btrfs-progs: test: use nullb helpers in 031-zoned-bgt Naohiro Aota
2024-06-03 19:36 ` [PATCH v4 00/10] btrfs-progs: zoned: proper "mkfs.btrfs -b" support David Sterba

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