summaryrefslogtreecommitdiff
path: root/libbcachefs/journal_reclaim.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-11-01 06:39:12 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-11-01 06:39:12 -0400
commit0da2d968eb7d78417693347597ce091a515f646b (patch)
tree3ab44769d7a4ac7c3320afaf2016aca9166396ab /libbcachefs/journal_reclaim.c
parenta315a3f664f9cf5cc687738ad97210721ccde8fd (diff)
Update bcachefs sources to 043cfba30c fixup! bcachefs: Improve transaction restart handling in fsck code
Diffstat (limited to 'libbcachefs/journal_reclaim.c')
-rw-r--r--libbcachefs/journal_reclaim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libbcachefs/journal_reclaim.c b/libbcachefs/journal_reclaim.c
index c468d597..a93f5b18 100644
--- a/libbcachefs/journal_reclaim.c
+++ b/libbcachefs/journal_reclaim.c
@@ -34,8 +34,10 @@ unsigned bch2_journal_dev_buckets_available(struct journal *j,
struct journal_device *ja,
enum journal_space_from from)
{
- unsigned available = (journal_space_from(ja, from) -
- ja->cur_idx - 1 + ja->nr) % ja->nr;
+ unsigned available = !test_bit(JOURNAL_NOCHANGES, &j->flags)
+ ? ((journal_space_from(ja, from) -
+ ja->cur_idx - 1 + ja->nr) % ja->nr)
+ : ja->nr;
/*
* Don't use the last bucket unless writing the new last_seq