mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-25 19:42:19 +00:00
bcachefs: Fix allocator + journal interaction
The allocator needs to wait until the last update touching a bucket has been commited before writing to it again. However, the code was checking against the last dirty journal sequence number, not the last flushed journal sequence number. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
committed by
Kent Overstreet
parent
a786087744
commit
36f035e908
@@ -594,7 +594,7 @@ static void find_reclaimable_buckets_lru(struct bch_fs *c, struct bch_dev *ca)
|
||||
buckets = bucket_array(ca);
|
||||
ca->alloc_heap.used = 0;
|
||||
now = atomic64_read(&c->io_clock[READ].now);
|
||||
last_seq_ondisk = c->journal.last_seq_ondisk;
|
||||
last_seq_ondisk = c->journal.flushed_seq_ondisk;
|
||||
|
||||
/*
|
||||
* Find buckets with lowest read priority, by building a maxheap sorted
|
||||
|
||||
@@ -50,7 +50,7 @@ static inline void fs_usage_data_type_to_base(struct bch_fs_usage *fs_usage,
|
||||
void bch2_bucket_seq_cleanup(struct bch_fs *c)
|
||||
{
|
||||
u64 journal_seq = atomic64_read(&c->journal.seq);
|
||||
u16 last_seq_ondisk = c->journal.last_seq_ondisk;
|
||||
u16 last_seq_ondisk = c->journal.flushed_seq_ondisk;
|
||||
struct bch_dev *ca;
|
||||
struct bucket_array *buckets;
|
||||
struct bucket *g;
|
||||
|
||||
Reference in New Issue
Block a user