Commit f87bf892 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: fix setting version_upgrade_complete



If a superblock write hasn't happened (i.e. we never had to go rw), then
c->sb.version will be out of date w.r.t. c->disk_sb.sb->version.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent f2eb8434
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -868,8 +868,8 @@ int bch2_fs_recovery(struct bch_fs *c)
	}

	mutex_lock(&c->sb_lock);
	if (BCH_SB_VERSION_UPGRADE_COMPLETE(c->disk_sb.sb) != c->sb.version) {
		SET_BCH_SB_VERSION_UPGRADE_COMPLETE(c->disk_sb.sb, c->sb.version);
	if (BCH_SB_VERSION_UPGRADE_COMPLETE(c->disk_sb.sb) != le16_to_cpu(c->disk_sb.sb->version)) {
		SET_BCH_SB_VERSION_UPGRADE_COMPLETE(c->disk_sb.sb, le16_to_cpu(c->disk_sb.sb->version));
		write_sb = true;
	}