btrfs-progs/mkfs
Naohiro Aota 970c1a543c btrfs-progs: mkfs: align byte_count with sectorsize and zone size
While "byte_count" is eventually rounded down to sectorsize at make_btrfs()
or btrfs_add_to_fs_id(), it would be better round it down first and do the
size checks not to confuse the things.

Also, on a zoned device, creating a filesystem whose size is not aligned
to the zone boundary can be confusing. Round it down further to the zone
boundary.

The size calculation with a source directory is also tweaked to be aligned.
device_get_partition_size_fd_stat() must be aligned down not to exceed the
device size. And, btrfs_mkfs_size_dir() should have return sectorsize aligned
size. So, add an UASSERT for it.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-06-03 21:17:34 +02:00
..
Makefile btrfs-progs: build: add stub makefile to image and mkfs 2019-07-04 15:36:01 +02:00
common.c btrfs-progs: mkfs: fix minimum size calculation for zoned mode 2024-06-03 21:17:15 +02:00
common.h btrfs-progs: mkfs: unify zoned mode minimum size calc into btrfs_min_dev_size() 2024-06-03 21:15:26 +02:00
main.c btrfs-progs: mkfs: align byte_count with sectorsize and zone size 2024-06-03 21:17:34 +02:00
rootdir.c btrfs-progs: reorder key initializations 2024-04-30 21:49:15 +02:00
rootdir.h btrfs-progs: mkfs: more verbose output for --rootdir 2023-05-26 22:17:33 +02:00