Skip to content

Commit

Permalink
dm snapshot: flush disk cache when merging
Browse files Browse the repository at this point in the history
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.

Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Aug 2, 2011
1 parent 6140333 commit 762a80d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-snap-persistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ static int persistent_commit_merge(struct dm_exception_store *store,
for (i = 0; i < nr_merged; i++)
clear_exception(ps, ps->current_committed - 1 - i);

r = area_io(ps, WRITE);
r = area_io(ps, WRITE_FLUSH_FUA);
if (r < 0)
return r;

Expand Down

0 comments on commit 762a80d

Please sign in to comment.