summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-03-07 17:19:04 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2019-03-17 14:30:12 -0400
commit422243522747e4b4315d479c7631943c78569fb1 (patch)
tree6d153658c8a26e95dbc29c384e9309844f6804a3
parent3a0020885347f0f55fc3f1c3fc0f74cd2dc0251f (diff)
bcachefs: minor journal reclaim fixes
-rw-r--r--fs/bcachefs/journal_reclaim.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c
index eb9894627367..5cee6872c1f1 100644
--- a/fs/bcachefs/journal_reclaim.c
+++ b/fs/bcachefs/journal_reclaim.c
@@ -501,8 +501,8 @@ void bch2_journal_reclaim(struct journal *j)
nr_buckets = min(nr_buckets, ja->nr);
bucket_to_flush = (ja->cur_idx + nr_buckets) % ja->nr;
- seq_to_flush = max_t(u64, seq_to_flush,
- ja->bucket_seq[bucket_to_flush]);
+ seq_to_flush = max(seq_to_flush,
+ ja->bucket_seq[bucket_to_flush]);
}
/* Also flush if the pin fifo is more than half full */
@@ -519,12 +519,14 @@ void bch2_journal_reclaim(struct journal *j)
msecs_to_jiffies(j->reclaim_delay_ms)))
min_nr = 1;
- if (j->prereserved.reserved * 2 > j->prereserved.remaining)
+ if (j->prereserved.reserved * 2 > j->prereserved.remaining) {
+ seq_to_flush = max(seq_to_flush, journal_last_seq(j));
min_nr = 1;
+ }
journal_flush_pins(j, seq_to_flush, min_nr);
- if (!test_bit(BCH_FS_RO, &c->flags))
+ if (!bch2_journal_error(j))
queue_delayed_work(c->journal_reclaim_wq, &j->reclaim_work,
msecs_to_jiffies(j->reclaim_delay_ms));
}