summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal_reclaim.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-07-17 19:19:14 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:07 +0300
commit4077991c8536595b50b52bab739ef1e9ac6a72cf (patch)
tree5b4b6c1cea87f26aaff4491e1e40d96b8b99c270 /fs/bcachefs/journal_reclaim.h
parent97446a242a56f9350be7b8985ed933fe9118f41e (diff)
downloadlinux-4077991c8536595b50b52bab739ef1e9ac6a72cf.tar.xz
bcachefs: Fix a use after free in the journal code
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_reclaim.h')
-rw-r--r--fs/bcachefs/journal_reclaim.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/bcachefs/journal_reclaim.h b/fs/bcachefs/journal_reclaim.h
index a93ed43cfc78..f5af4252c88a 100644
--- a/fs/bcachefs/journal_reclaim.h
+++ b/fs/bcachefs/journal_reclaim.h
@@ -6,19 +6,17 @@
static inline bool journal_pin_active(struct journal_entry_pin *pin)
{
- return pin->pin_list != NULL;
+ return pin->seq != 0;
}
static inline struct journal_entry_pin_list *
journal_seq_pin(struct journal *j, u64 seq)
{
- BUG_ON(seq < j->pin.front || seq >= j->pin.back);
+ EBUG_ON(seq < j->pin.front || seq >= j->pin.back);
return &j->pin.data[seq & j->pin.mask];
}
-u64 bch2_journal_pin_seq(struct journal *, struct journal_entry_pin *);
-
void bch2_journal_pin_add(struct journal *, u64, struct journal_entry_pin *,
journal_pin_flush_fn);
void bch2_journal_pin_drop(struct journal *, struct journal_entry_pin *);
@@ -26,6 +24,7 @@ void bch2_journal_pin_add_if_older(struct journal *,
struct journal_entry_pin *,
struct journal_entry_pin *,
journal_pin_flush_fn);
+void bch2_journal_pin_flush(struct journal *, struct journal_entry_pin *);
void bch2_journal_reclaim_fast(struct journal *);
void bch2_journal_reclaim_work(struct work_struct *);