mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 08:47:44 -04:00
bcachefs: Fix journal reclaim spinning in recovery
We can't run journal reclaim until we've finished replaying updates to interior btree nodes - the check for this was in the wrong place though, leading to journal reclaim spinning before it was allowed to proceed. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
89931472c2
commit
5731cf0156
@@ -609,6 +609,10 @@ static int bch2_journal_reclaim_thread(void *arg)
|
||||
struct journal *j = arg;
|
||||
unsigned long next;
|
||||
|
||||
set_freezable();
|
||||
|
||||
kthread_wait_freezable(test_bit(JOURNAL_RECLAIM_STARTED, &j->flags));
|
||||
|
||||
while (!kthread_should_stop()) {
|
||||
j->reclaim_kicked = false;
|
||||
|
||||
@@ -627,6 +631,7 @@ static int bch2_journal_reclaim_thread(void *arg)
|
||||
if (time_after_eq(jiffies, next))
|
||||
break;
|
||||
schedule_timeout(next - jiffies);
|
||||
try_to_freeze();
|
||||
|
||||
}
|
||||
__set_current_state(TASK_RUNNING);
|
||||
|
||||
@@ -616,6 +616,7 @@ static int bch2_journal_replay(struct bch_fs *c,
|
||||
*/
|
||||
set_bit(BCH_FS_BTREE_INTERIOR_REPLAY_DONE, &c->flags);
|
||||
set_bit(JOURNAL_RECLAIM_STARTED, &j->flags);
|
||||
journal_reclaim_kick(j);
|
||||
|
||||
j->replay_journal_seq = seq;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user