提交 117aceb0 编写于 作者: S Somasundaram Krishnasamy 提交者: Mike Snitzer

dm era: save spacemap metadata root after the pre-commit

When committing era metadata to disk, it doesn't always save the latest
spacemap metadata root in superblock. Due to this, metadata is getting
corrupted sometimes when reopening the device. The correct order of update
should be, pre-commit (shadows spacemap root), save the spacemap root
(newly shadowed block) to in-core superblock and then the final commit.

Cc: stable@vger.kernel.org
Signed-off-by: NSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
上级 948f581a
...@@ -961,15 +961,15 @@ static int metadata_commit(struct era_metadata *md) ...@@ -961,15 +961,15 @@ static int metadata_commit(struct era_metadata *md)
} }
} }
r = save_sm_root(md); r = dm_tm_pre_commit(md->tm);
if (r) { if (r) {
DMERR("%s: save_sm_root failed", __func__); DMERR("%s: pre commit failed", __func__);
return r; return r;
} }
r = dm_tm_pre_commit(md->tm); r = save_sm_root(md);
if (r) { if (r) {
DMERR("%s: pre commit failed", __func__); DMERR("%s: save_sm_root failed", __func__);
return r; return r;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册