Skip to content

Commit

Permalink
bcachefs: bcachefs_metadata_version_autofix_errors
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
Kent Overstreet committed Dec 11, 2024
1 parent 71ae4c7 commit 79c1539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/bcachefs/bcachefs_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,8 @@ struct bch_sb_field_ext {
x(disk_accounting_big_endian, BCH_VERSION(1, 15)) \
x(reflink_p_may_update_opts, BCH_VERSION(1, 16)) \
x(inode_depth, BCH_VERSION(1, 17)) \
x(persistent_inode_cursors, BCH_VERSION(1, 18))
x(persistent_inode_cursors, BCH_VERSION(1, 18)) \
x(autofix_errors, BCH_VERSION(1, 19))

enum bcachefs_metadata_version {
bcachefs_metadata_version_min = 9,
Expand Down
5 changes: 5 additions & 0 deletions fs/bcachefs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ int bch2_fs_recovery(struct bch_fs *c)

c->opts.recovery_passes |= bch2_recovery_passes_from_stable(le64_to_cpu(ext->recovery_passes_required[0]));

if (c->sb.version_upgrade_complete < bcachefs_metadata_version_autofix_errors) {
SET_BCH_SB_ERROR_ACTION(c->disk_sb.sb, BCH_ON_ERROR_fix_safe);
write_sb = true;
}

if (write_sb)
bch2_write_super(c);
mutex_unlock(&c->sb_lock);
Expand Down

0 comments on commit 79c1539

Please sign in to comment.