summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>2017-04-07 19:14:55 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-20 12:28:37 (GMT)
commitf6ec18eb7425a334689584fcf5849107858fbd25 (patch)
tree8fbf190710c9423750a6a1fdaad91984ad67d166 /drivers/md
parentf8d05099ec72a943a71b2c95959d37dbef13b7f1 (diff)
downloadlinux-f6ec18eb7425a334689584fcf5849107858fbd25.tar.xz
dm era: save spacemap metadata root after the pre-commit
commit 117aceb030307dcd431fdcff87ce988d3016c34a upstream. 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. Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-era-target.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c
index bf2b267..80e3df1 100644
--- a/drivers/md/dm-era-target.c
+++ b/drivers/md/dm-era-target.c
@@ -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) {
- DMERR("%s: save_sm_root failed", __func__);
+ DMERR("%s: pre commit failed", __func__);
return r;
}
- r = dm_tm_pre_commit(md->tm);
+ r = save_sm_root(md);
if (r) {
- DMERR("%s: pre commit failed", __func__);
+ DMERR("%s: save_sm_root failed", __func__);
return r;
}