Commit fcc4233
dm snapshot: flush merged data before committing metadata
If the origin device has a volatile write-back cache and the following
events occur:
1: After finishing merge operation of one set of exceptions,
merge_callback() is invoked.
2: Update the metadata in COW device tracking the merge completion.
This update to COW device is flushed cleanly.
3: System crashes and the origin device's cache where the recent
merge was completed has not been flushed.
During the next cycle when we read the metadata from the COW device,
we will skip reading those metadata whose merge was completed in
step (1). This will lead to data loss/corruption.
To address this, flush the origin device post merge IO before
updating the metadata.
Cc: stable@vger.kernel.org
Signed-off-by: Akilesh Kailash <akailash@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>1 parent d68b295 commit fcc4233
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
1121 | 1126 | | |
1122 | 1127 | | |
1123 | 1128 | | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
1124 | 1140 | | |
1125 | 1141 | | |
1126 | 1142 | | |
| |||
1134 | 1150 | | |
1135 | 1151 | | |
1136 | 1152 | | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1137 | 1158 | | |
1138 | 1159 | | |
1139 | 1160 | | |
| |||
1318 | 1339 | | |
1319 | 1340 | | |
1320 | 1341 | | |
| 1342 | + | |
1321 | 1343 | | |
1322 | 1344 | | |
1323 | 1345 | | |
| |||
1504 | 1526 | | |
1505 | 1527 | | |
1506 | 1528 | | |
| 1529 | + | |
| 1530 | + | |
1507 | 1531 | | |
1508 | 1532 | | |
1509 | 1533 | | |
| |||
0 commit comments