diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-01-21 15:32:13 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:14 -0400 |
commit | 7ef2a73a5881323d53453cc3be7261fe1a49af1d (patch) | |
tree | 85e8d67b00a6c28dd8691e79d1674c111e8a1328 /fs/bcachefs/migrate.c | |
parent | dbaee468461bfa82e6453ca0e009e9661cc570da (diff) | |
download | lwn-7ef2a73a5881323d53453cc3be7261fe1a49af1d.tar.gz lwn-7ef2a73a5881323d53453cc3be7261fe1a49af1d.zip |
bcachefs: Fix check for if extent update is allocating
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/migrate.c')
-rw-r--r-- | fs/bcachefs/migrate.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/bcachefs/migrate.c b/fs/bcachefs/migrate.c index 63fe8cbb0564..b97a5a8f3910 100644 --- a/fs/bcachefs/migrate.c +++ b/fs/bcachefs/migrate.c @@ -5,6 +5,7 @@ #include "bcachefs.h" #include "btree_update.h" +#include "btree_update_interior.h" #include "buckets.h" #include "extents.h" #include "io.h" @@ -153,6 +154,16 @@ retry: bch2_btree_iter_unlock(&iter); } + /* flush relevant btree updates */ + while (1) { + closure_wait_event(&c->btree_interior_update_wait, + !bch2_btree_interior_updates_nr_pending(c) || + c->btree_roots_dirty); + if (!bch2_btree_interior_updates_nr_pending(c)) + break; + bch2_journal_meta(&c->journal); + } + ret = 0; out: ret = bch2_replicas_gc_end(c, ret); |