summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-10-29 01:22:25 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:15 +0300
commitfae1157d184084f1716a10273423f8e949d8471f (patch)
treefb5a654f7bdde8e55b8c78f04ea0d92f181d68a9 /fs/bcachefs/journal.h
parent285b181ad460bb240041a9ca7935f9e884040405 (diff)
downloadlinux-fae1157d184084f1716a10273423f8e949d8471f.tar.xz
bcachefs: Ensure journal doesn't get stuck in nochanges mode
This tweaks the journal code to always act as if there's space available in nochanges mode, when we're not going to be doing any writes. This helps in recovering filesystems that won't mount because they need journal replay and the journal has gotten stuck. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/journal.h')
-rw-r--r--fs/bcachefs/journal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h
index 1d556790b38e..99fd253648bf 100644
--- a/fs/bcachefs/journal.h
+++ b/fs/bcachefs/journal.h
@@ -446,6 +446,7 @@ static inline int bch2_journal_preres_get_fast(struct journal *j,
ret = 0;
if ((flags & JOURNAL_RES_GET_RESERVED) ||
+ test_bit(JOURNAL_NOCHANGES, &j->flags) ||
new.reserved + d < new.remaining) {
new.reserved += d;
ret = 1;