diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-01-02 02:45:30 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:21 +0200 |
commit | f28620c108a9476c7b4b25b8e36b94b6b2b29295 (patch) | |
tree | e63cd4c868cd7bb5d0b8e89e86d28c1339a048b8 | |
parent | bcachefs: Make sure BCH_FS_FSCK_DONE gets set (diff) | |
download | linux-f28620c108a9476c7b4b25b8e36b94b6b2b29295.tar.xz linux-f28620c108a9476c7b4b25b8e36b94b6b2b29295.zip |
bcachefs: Tweak journal reclaim order
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | fs/bcachefs/recovery.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 39b5b97704b7..219351654564 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -116,12 +116,19 @@ int bch2_journal_key_insert_take(struct bch_fs *c, enum btree_id id, .btree_id = id, .level = level, .k = k, - .allocated = true + .allocated = true, + /* + * Ensure these keys are done last by journal replay, to unblock + * journal reclaim: + */ + .journal_seq = U32_MAX, }; struct journal_keys *keys = &c->journal_keys; struct journal_iter *iter; unsigned idx = journal_key_search(keys, id, level, k->k.p); + BUG_ON(test_bit(BCH_FS_RW, &c->flags)); + if (idx < keys->nr && journal_key_cmp(&n, &keys->d[idx]) == 0) { if (keys->d[idx].allocated) |