dm snapshot: flush disk cache when merging
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 2 Aug 2011 11:32:00 +0000 (12:32 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Aug 2011 04:58:42 +0000 (21:58 -0700)
commitb41ed9c38a42daa4b474ebf18eb06ef1f17351f5
treecb82dcf03bce59367a52d77a24083f840247c3e0
parentee607aa21a02855bc4ae6c4c775fd3456f961404
dm snapshot: flush disk cache when merging

commit 762a80d9fc9f690a3a35983f3b4619a220650808 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: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-snap-persistent.c