bcachefs: Ensure proper write alignment
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 4 May 2025 20:31:40 +0000 (16:31 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 5 May 2025 18:19:01 +0000 (14:19 -0400)
commit50a7b899a0d806f961edadfc3357cb6679826795
treed829e64524726c743c6e84bac4a3f26d173cb01b
parent844f766e02d0aba973d78f3ade38ad8bae399347
bcachefs: Ensure proper write alignment

There was a buggy version of bcachefs-tools which picked misaligned
bucket sizes when formatting, and we're also about to do dynamic block
sizes - which will allow picking logical block size or physical block
size of the device per-write, allowing for better compression ratios at
the cost of slightly worse write performance (i.e. forcing the device to
do RMW or extra buffering).

To account for this, tweak bch2_alloc_sectors_start() to properly align
open_buckets to the blocksize of the write we're about to do.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_foreground.c