Commit 813e0cec authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Upgrade path fixes

Some minor fixes to not print errors that are actually due to a verson
upgrade.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 6132c84c
......@@ -477,7 +477,7 @@ static int check_bp_exists(struct btree_trans *trans,
prt_printf(&buf, "\nbp pos ");
bch2_bpos_to_text(&buf, bp_iter.pos);
if (c->sb.version < bcachefs_metadata_version_backpointers ||
if (c->sb.version_upgrade_complete < bcachefs_metadata_version_backpointers ||
c->opts.reconstruct_alloc ||
fsck_err(c, "%s", buf.buf))
ret = bch2_bucket_backpointer_mod(trans, bucket, bp, orig_k, true);
......
......@@ -677,11 +677,11 @@ enum bch_write_ref {
x(check_alloc_to_lru_refs, PASS_FSCK) \
x(fs_freespace_init, PASS_ALWAYS|PASS_SILENT) \
x(bucket_gens_init, 0) \
x(fs_upgrade_for_subvolumes, 0) \
x(check_snapshot_trees, PASS_FSCK) \
x(check_snapshots, PASS_FSCK) \
x(check_subvols, PASS_FSCK) \
x(delete_dead_snapshots, PASS_FSCK|PASS_UNCLEAN|PASS_SILENT) \
x(fs_upgrade_for_subvolumes, 0) \
x(check_inodes, PASS_FSCK|PASS_UNCLEAN) \
x(check_extents, PASS_FSCK) \
x(check_dirents, PASS_FSCK) \
......
......@@ -1272,7 +1272,7 @@ int bch2_mark_reflink_p(struct btree_trans *trans,
BUG_ON(!(flags & BTREE_TRIGGER_GC));
if (c->sb.version >= bcachefs_metadata_version_reflink_p_fix) {
if (c->sb.version_upgrade_complete >= bcachefs_metadata_version_reflink_p_fix) {
idx -= le32_to_cpu(p.v->front_pad);
end += le32_to_cpu(p.v->back_pad);
}
......
......@@ -422,6 +422,9 @@ static int bch2_sb_validate(struct bch_sb_handle *disk_sb, struct printbuf *out,
SET_BCH_SB_JOURNAL_FLUSH_DELAY(sb, 1000);
if (!BCH_SB_JOURNAL_RECLAIM_DELAY(sb))
SET_BCH_SB_JOURNAL_RECLAIM_DELAY(sb, 1000);
if (!BCH_SB_VERSION_UPGRADE_COMPLETE(sb))
SET_BCH_SB_VERSION_UPGRADE_COMPLETE(sb, le16_to_cpu(sb->version));
}
for (opt_id = 0; opt_id < bch2_opts_nr; opt_id++) {
......@@ -496,7 +499,7 @@ static void bch2_sb_update(struct bch_fs *c)
c->sb.user_uuid = src->user_uuid;
c->sb.version = le16_to_cpu(src->version);
c->sb.version_min = le16_to_cpu(src->version_min);
c->sb.version_upgrade_complete = BCH_SB_VERSION_UPGRADE_COMPLETE(src) ?: c->sb.version;
c->sb.version_upgrade_complete = BCH_SB_VERSION_UPGRADE_COMPLETE(src);
c->sb.nr_devices = src->nr_devices;
c->sb.clean = BCH_SB_CLEAN(src);
c->sb.encryption_type = BCH_SB_ENCRYPTION_TYPE(src);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment