Commit 1484d4f
dm thin metadata: try to avoid ever aborting transactions
[ Upstream commit 3ab9182 ]
Committing a transaction can consume some metadata of it's own, we now
reserve a small amount of metadata to cover this. Free metadata
reported by the kernel will not include this reserve.
If any of the reserve has been used after a commit we enter a new
internal state PM_OUT_OF_METADATA_SPACE. This is reported as
PM_READ_ONLY, so no userland changes are needed. If the metadata
device is resized the pool will move back to PM_WRITE.
These changes mean we never need to abort and rollback a transaction due
to running out of metadata space. This is particularly important
because there have been a handful of reports of data corruption against
DM thin-provisioning that can all be attributed to the thin-pool having
ran out of metadata space.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 1e9054e commit 1484d4f
2 files changed
Lines changed: 100 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
191 | 197 | | |
192 | 198 | | |
193 | 199 | | |
| |||
825 | 831 | | |
826 | 832 | | |
827 | 833 | | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
828 | 850 | | |
829 | 851 | | |
830 | 852 | | |
| |||
858 | 880 | | |
859 | 881 | | |
860 | 882 | | |
| 883 | + | |
| 884 | + | |
861 | 885 | | |
862 | 886 | | |
863 | 887 | | |
| |||
1829 | 1853 | | |
1830 | 1854 | | |
1831 | 1855 | | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
1832 | 1863 | | |
1833 | 1864 | | |
1834 | 1865 | | |
| |||
1941 | 1972 | | |
1942 | 1973 | | |
1943 | 1974 | | |
1944 | | - | |
| 1975 | + | |
1945 | 1976 | | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
1946 | 1980 | | |
1947 | 1981 | | |
1948 | 1982 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
203 | 208 | | |
| 209 | + | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
| |||
1382 | 1388 | | |
1383 | 1389 | | |
1384 | 1390 | | |
1385 | | - | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
1386 | 1420 | | |
1387 | 1421 | | |
1388 | 1422 | | |
| |||
1408 | 1442 | | |
1409 | 1443 | | |
1410 | 1444 | | |
1411 | | - | |
| 1445 | + | |
1412 | 1446 | | |
1413 | 1447 | | |
1414 | 1448 | | |
1415 | 1449 | | |
1416 | 1450 | | |
1417 | | - | |
1418 | | - | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
1419 | 1455 | | |
1420 | 1456 | | |
1421 | 1457 | | |
| |||
1481 | 1517 | | |
1482 | 1518 | | |
1483 | 1519 | | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1484 | 1533 | | |
1485 | 1534 | | |
1486 | 1535 | | |
| |||
1512 | 1561 | | |
1513 | 1562 | | |
1514 | 1563 | | |
| 1564 | + | |
1515 | 1565 | | |
1516 | 1566 | | |
1517 | 1567 | | |
| |||
2475 | 2525 | | |
2476 | 2526 | | |
2477 | 2527 | | |
| 2528 | + | |
2478 | 2529 | | |
2479 | | - | |
| 2530 | + | |
2480 | 2531 | | |
2481 | 2532 | | |
2482 | 2533 | | |
| |||
3412 | 3463 | | |
3413 | 3464 | | |
3414 | 3465 | | |
| 3466 | + | |
| 3467 | + | |
| 3468 | + | |
| 3469 | + | |
3415 | 3470 | | |
3416 | 3471 | | |
3417 | 3472 | | |
| |||
3715 | 3770 | | |
3716 | 3771 | | |
3717 | 3772 | | |
3718 | | - | |
| 3773 | + | |
3719 | 3774 | | |
3720 | 3775 | | |
3721 | 3776 | | |
| |||
3789 | 3844 | | |
3790 | 3845 | | |
3791 | 3846 | | |
| 3847 | + | |
3792 | 3848 | | |
3793 | 3849 | | |
3794 | 3850 | | |
| |||
3859 | 3915 | | |
3860 | 3916 | | |
3861 | 3917 | | |
3862 | | - | |
| 3918 | + | |
| 3919 | + | |
3863 | 3920 | | |
3864 | | - | |
| 3921 | + | |
3865 | 3922 | | |
3866 | 3923 | | |
3867 | 3924 | | |
| |||
0 commit comments