diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-14 05:01:47 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:57 +0300 |
commit | b40901b0f7182557851c8e9af31bacfbbd76b1ec (patch) | |
tree | dc79e846434408cba88247620c828dca3c17c278 /fs/bcachefs/move.c | |
parent | b9fa375bab2786d0d2c5435b5e3fceaf6594aaf3 (diff) | |
download | linux-b40901b0f7182557851c8e9af31bacfbbd76b1ec.tar.xz |
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>
Diffstat (limited to 'fs/bcachefs/move.c')
-rw-r--r-- | fs/bcachefs/move.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c index f74ef947cac5..4a9ffca7be62 100644 --- a/fs/bcachefs/move.c +++ b/fs/bcachefs/move.c @@ -59,7 +59,6 @@ struct moving_io { static void move_free(struct moving_io *io) { struct moving_context *ctxt = io->write.ctxt; - struct bch_fs *c = ctxt->c; if (io->b) atomic_dec(&io->b->count); @@ -71,7 +70,6 @@ static void move_free(struct moving_io *io) wake_up(&ctxt->wait); mutex_unlock(&ctxt->lock); - bch2_write_ref_put(c, BCH_WRITE_REF_move); kfree(io); } @@ -280,9 +278,6 @@ static int bch2_move_extent(struct btree_trans *trans, return 0; } - if (!bch2_write_ref_tryget(c, BCH_WRITE_REF_move)) - return -BCH_ERR_erofs_no_writes; - /* * Before memory allocations & taking nocow locks in * bch2_data_update_init(): @@ -378,7 +373,6 @@ err_free_pages: err_free: kfree(io); err: - bch2_write_ref_put(c, BCH_WRITE_REF_move); trace_and_count(c, move_extent_alloc_mem_fail, k.k); return ret; } |