Commit b41ed9c3 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Greg Kroah-Hartman

dm snapshot: flush disk cache when merging

commit 762a80d9 upstream.

This patch makes dm-snapshot flush disk cache when writing metadata for
merging snapshot.

Without cache flushing the disk may reorder metadata write and other
data writes and there is a possibility of data corruption in case of
power fault.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ee607aa2
...@@ -753,7 +753,7 @@ static int persistent_commit_merge(struct dm_exception_store *store, ...@@ -753,7 +753,7 @@ static int persistent_commit_merge(struct dm_exception_store *store,
for (i = 0; i < nr_merged; i++) for (i = 0; i < nr_merged; i++)
clear_exception(ps, ps->current_committed - 1 - i); clear_exception(ps, ps->current_committed - 1 - i);
r = area_io(ps, WRITE); r = area_io(ps, WRITE_FLUSH_FUA);
if (r < 0) if (r < 0)
return r; return r;
......
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