diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-04-28 22:12:07 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:02 -0400 |
commit | 2ce867df3161886cfc6baf54aa9ef53f2281cdee (patch) | |
tree | f697ed2cb9bc3791e11629154f8582f0f7c8c016 /fs/bcachefs/journal_reclaim.h | |
parent | 050197b1c1df1cfee84523bf2183c8674e06d10f (diff) | |
download | linux-2ce867df3161886cfc6baf54aa9ef53f2281cdee.tar.gz linux-2ce867df3161886cfc6baf54aa9ef53f2281cdee.tar.bz2 linux-2ce867df3161886cfc6baf54aa9ef53f2281cdee.zip |
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 <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_reclaim.h')
-rw-r--r-- | fs/bcachefs/journal_reclaim.h | 8 |
1 files changed, 3 insertions, 5 deletions
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 *, |