From 2ce867df3161886cfc6baf54aa9ef53f2281cdee Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 28 Apr 2021 22:12:07 -0400 Subject: bcachefs: Make sure to initialize j->last_flushed If the journal reclaim thread makes it to the timeout without ever initializing j->last_flushed, we could end up sleeping for a very long time. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/journal_reclaim.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fs/bcachefs/journal_reclaim.h') diff --git a/fs/bcachefs/journal_reclaim.h b/fs/bcachefs/journal_reclaim.h index adf1f5c981cd..0fd1af120db5 100644 --- a/fs/bcachefs/journal_reclaim.h +++ b/fs/bcachefs/journal_reclaim.h @@ -8,11 +8,9 @@ static inline void journal_reclaim_kick(struct journal *j) { struct task_struct *p = READ_ONCE(j->reclaim_thread); - if (p && !j->reclaim_kicked) { - j->reclaim_kicked = true; - if (p) - wake_up_process(p); - } + j->reclaim_kicked = true; + if (p) + wake_up_process(p); } unsigned bch2_journal_dev_buckets_available(struct journal *, -- cgit v1.2.3