]>
Commit | Line | Data |
---|---|---|
06ac8238 GKH |
1 | From 762a80d9fc9f690a3a35983f3b4619a220650808 Mon Sep 17 00:00:00 2001 |
2 | From: Mikulas Patocka <mpatocka@redhat.com> | |
3 | Date: Tue, 2 Aug 2011 12:32:00 +0100 | |
4 | Subject: dm snapshot: flush disk cache when merging | |
5 | ||
6 | From: Mikulas Patocka <mpatocka@redhat.com> | |
7 | ||
8 | commit 762a80d9fc9f690a3a35983f3b4619a220650808 upstream. | |
9 | ||
10 | This patch makes dm-snapshot flush disk cache when writing metadata for | |
11 | merging snapshot. | |
12 | ||
13 | Without cache flushing the disk may reorder metadata write and other | |
14 | data writes and there is a possibility of data corruption in case of | |
15 | power fault. | |
16 | ||
17 | Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> | |
18 | Signed-off-by: Alasdair G Kergon <agk@redhat.com> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
20 | ||
21 | --- | |
22 | drivers/md/dm-snap-persistent.c | 2 +- | |
23 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
24 | ||
25 | --- a/drivers/md/dm-snap-persistent.c | |
26 | +++ b/drivers/md/dm-snap-persistent.c | |
27 | @@ -753,7 +753,7 @@ static int persistent_commit_merge(struc | |
28 | for (i = 0; i < nr_merged; i++) | |
29 | clear_exception(ps, ps->current_committed - 1 - i); | |
30 | ||
31 | - r = area_io(ps, WRITE); | |
32 | + r = area_io(ps, WRITE_FLUSH_FUA); | |
33 | if (r < 0) | |
34 | return r; | |
35 |