bcachefs: New erasure coding shutdown path
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 14 Mar 2023 02:01:47 +0000 (22:01 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:57 +0000 (17:09 -0400)
commitb40901b0f7182557851c8e9af31bacfbbd76b1ec
treedc79e846434408cba88247620c828dca3c17c278
parentb9fa375bab2786d0d2c5435b5e3fceaf6594aaf3
bcachefs: New erasure coding shutdown path

This implements a new shutdown path for erasure coding, which is needed
for the upcoming BCH_WRITE_WAIT_FOR_EC write path.

The process is:
 - Cancel new stripes being built up
 - Close out/cancel open buckets on write points or the partial list
   that are for stripes
 - Shutdown rebalance/copygc
 - Then wait for in flight new stripes to finish

With BCH_WRITE_WAIT_FOR_EC, move ops will be waiting on stripes to fill
up before they complete; the new ec shutdown path is needed for shutting
down copygc/rebalance without deadlocking.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_foreground.c
fs/bcachefs/alloc_foreground.h
fs/bcachefs/bcachefs.h
fs/bcachefs/data_update.c
fs/bcachefs/ec.c
fs/bcachefs/ec.h
fs/bcachefs/io.c
fs/bcachefs/move.c
fs/bcachefs/super.c