bcachefs: Fix unnecessary read amplificaiton when allocating ec stripes
authorRobbie Litchfield <blam.kiwi@gmail.com>
Wed, 10 Feb 2021 00:18:13 +0000 (13:18 +1300)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:53 +0000 (17:08 -0400)
commit0ef837a0cc87d49d9f7d29bdef5a57f07ecc84d3
tree7161856bca1da971b86022a113144f12cb89bfdc
parent2bb748a69596e883cf9ea28321d43f8c6a225cef
bcachefs: Fix unnecessary read amplificaiton when allocating ec stripes

When allocating an erasure coding stripe, bcachefs will always reuse any
partial stripes before reserving a new stripe. This causes unnecessary
read amplification when preparing a stripe for writing. This patch changes
bcachefs to always reserve new stripes first, only relying on stripe reuse
when copygc needs more time to empty buckets from existing stripes.

Signed-off-by: Robbie Litchfield <blam.kiwi@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/ec.c