bcachefs: Fix bch2_extent_fallocate()
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 13 Aug 2023 22:04:32 +0000 (18:04 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:11 +0000 (17:10 -0400)
commitc8ef8c3eb573ae2d7f7f41d93f0e34b8f6dfcd6f
tree5c47400c36d3ed3bd8cf2b26376e6d9cbedeb03d
parentff5b741c25fb9546d876ca4c0c1d8720f6a2471c
bcachefs: Fix bch2_extent_fallocate()

 - There was no need for a retry loop in bch2_extent_fallocate(); if we
   have to retry we may be overwriting something different and we need
   to return an error and let the caller retry.
 - The bch2_alloc_sectors_start() error path was wrong, and wasn't
   running our cleanup at the end of the function

This also fixes a very rare open bucket leak due to the missing cleanup.

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