diff options
author | 2024-12-10 14:19:30 -0500 | |
---|---|---|
committer | 2025-01-09 23:38:41 -0500 | |
commit | 3db3084a86c3690e4b50b8579b0b1bbc29897375 (patch) | |
tree | 3778d1ebeb1893ffcf6406c10c77a8dcd61b6461 | |
parent | bcachefs: bcachefs_metadata_version_persistent_inode_cursors (diff) | |
download | wireguard-linux-3db3084a86c3690e4b50b8579b0b1bbc29897375.tar.xz wireguard-linux-3db3084a86c3690e4b50b8579b0b1bbc29897375.zip |
bcachefs: bcachefs_metadata_version_autofix_errors
It's time to make self healing the default: change the error action for
old filesystems to fix_safe, matching the default for current
filesystems.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 3 | ||||
-rw-r--r-- | fs/bcachefs/recovery.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index 09e53bef1a30..b0fac8b7915b 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -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, diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 383e03606d6e..98825437381c 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -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); |