summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-04-24 18:02:59 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:02 -0400
commit4932e07ea04bcc7f1649052183d1ebbab30c711c (patch)
tree8b44aa3a030d377091d7221f9f38a3eb7a0a4c48 /fs/bcachefs/recovery.c
parent0098376f03c1e9591beeab9815c4d756dd2d68a7 (diff)
downloadlwn-4932e07ea04bcc7f1649052183d1ebbab30c711c.tar.gz
lwn-4932e07ea04bcc7f1649052183d1ebbab30c711c.zip
bcachefs: Fix key cache assertion
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 2dc3dee4efc8..fe6886e42216 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -973,7 +973,7 @@ int bch2_fs_recovery(struct bch_fs *c)
struct jset *last_journal_entry = NULL;
u64 blacklist_seq, journal_seq;
bool write_sb = false;
- int ret;
+ int ret = 0;
if (c->sb.clean)
clean = read_superblock_clean(c);
@@ -1253,10 +1253,9 @@ use_clean:
if (c->journal_seq_blacklist_table &&
c->journal_seq_blacklist_table->nr > 128)
queue_work(system_long_wq, &c->journal_seq_blacklist_gc_work);
-out:
+
ret = 0;
-err:
-fsck_err:
+out:
set_bit(BCH_FS_FSCK_DONE, &c->flags);
bch2_flush_fsck_errs(c);
@@ -1270,6 +1269,10 @@ fsck_err:
else
bch_verbose(c, "ret %i", ret);
return ret;
+err:
+fsck_err:
+ bch2_fs_emergency_read_only(c);
+ goto out;
}
int bch2_fs_initialize(struct bch_fs *c)