Commit e4657cb
committed
librbd: stop filtering async request error codes
The roots of this go back to 2015 when snap create was changed to
filter EEXIST in commit 63f6c9b ("librbd: fixed snap create race
conditions") and flatten respectively EINVAL in commit ef7e210
("librbd: better handling for duplicate flatten requests"). From there
this pattern made it to most other operations that can be proxied
including "rbd migration execute".
The motivation was to suppress generation of an "expected" error in
response to a duplicate async request notification for the operation.
However, doing this at the top of the handler (right before returning
to the caller) and for an error as generic as EINVAL is super fragile.
It's trivial for an error that is being filtered to sneak in with
a lower level change completely unnoticed. For example, live migration
recently added NBD stream which is implemented on top of libnbd and it
turns out that some libnbd APIs return EINVAL on various occasions when
the NBD endpoint disappears and an error like ENOTCONN would make more
sense. If this occurs during "rbd migration execute" operation, the
rest of librbd never learns that migration was disrupted and the image
is transitioned to MIGRATION_STATE_EXECUTED, thus handing a partially
imported (read: corrupted) image to the user.
Luckily, with commits 07fbc4b ("librbd: track complete async
operation requests") and 96bc204 ("librbd: track complete async
operation return code"), the scenario which originally prompted error
code filtering isn't an issue anymore. Despite a few shortcomings
(e.g. when an async request notification is acked with result 0, it's
impossible to tell whether a) a new operation was kicked off, b) there
is an operation that is still in progress or c) it's for an operation
that completed earlier but hasn't "expired" yet), even just commit
07fbc4b by itself prevents a duplicate notification from kicking
off a second operation that could generate an error for something that
actually succeeded. With that in mind, eradicate error code filtering
from Operations class.
Fixes: https://tracker.ceph.com/issues/58185
Signed-off-by: Ilya Dryomov <[email protected]>1 parent bceddc4 commit e4657cb
1 file changed
+15
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
| |||
194 | 193 | | |
195 | 194 | | |
196 | 195 | | |
197 | | - | |
198 | 196 | | |
199 | 197 | | |
200 | 198 | | |
201 | | - | |
| 199 | + | |
202 | 200 | | |
203 | 201 | | |
204 | 202 | | |
| |||
382 | 380 | | |
383 | 381 | | |
384 | 382 | | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | 383 | | |
389 | 384 | | |
390 | 385 | | |
| |||
503 | 498 | | |
504 | 499 | | |
505 | 500 | | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | 501 | | |
510 | | - | |
| 502 | + | |
511 | 503 | | |
512 | 504 | | |
513 | 505 | | |
| |||
582 | 574 | | |
583 | 575 | | |
584 | 576 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
| 577 | + | |
589 | 578 | | |
590 | 579 | | |
591 | 580 | | |
| |||
686 | 675 | | |
687 | 676 | | |
688 | 677 | | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | 678 | | |
693 | 679 | | |
694 | | - | |
| 680 | + | |
695 | 681 | | |
696 | 682 | | |
697 | 683 | | |
| |||
874 | 860 | | |
875 | 861 | | |
876 | 862 | | |
877 | | - | |
| 863 | + | |
878 | 864 | | |
879 | 865 | | |
880 | 866 | | |
| |||
1077 | 1063 | | |
1078 | 1064 | | |
1079 | 1065 | | |
1080 | | - | |
| 1066 | + | |
1081 | 1067 | | |
1082 | 1068 | | |
1083 | 1069 | | |
| |||
1173 | 1159 | | |
1174 | 1160 | | |
1175 | 1161 | | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | 1162 | | |
1180 | 1163 | | |
1181 | 1164 | | |
| |||
1184 | 1167 | | |
1185 | 1168 | | |
1186 | 1169 | | |
1187 | | - | |
1188 | | - | |
1189 | | - | |
1190 | 1170 | | |
1191 | 1171 | | |
1192 | 1172 | | |
1193 | | - | |
| 1173 | + | |
1194 | 1174 | | |
1195 | 1175 | | |
1196 | 1176 | | |
| |||
1275 | 1255 | | |
1276 | 1256 | | |
1277 | 1257 | | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | 1258 | | |
1282 | 1259 | | |
1283 | 1260 | | |
| |||
1286 | 1263 | | |
1287 | 1264 | | |
1288 | 1265 | | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | 1266 | | |
1293 | | - | |
| 1267 | + | |
| 1268 | + | |
1294 | 1269 | | |
1295 | 1270 | | |
1296 | 1271 | | |
| |||
1373 | 1348 | | |
1374 | 1349 | | |
1375 | 1350 | | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | 1351 | | |
1380 | 1352 | | |
1381 | 1353 | | |
| |||
1384 | 1356 | | |
1385 | 1357 | | |
1386 | 1358 | | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | 1359 | | |
1391 | | - | |
| 1360 | + | |
| 1361 | + | |
1392 | 1362 | | |
1393 | 1363 | | |
1394 | 1364 | | |
| |||
1709 | 1679 | | |
1710 | 1680 | | |
1711 | 1681 | | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | 1682 | | |
1716 | 1683 | | |
1717 | 1684 | | |
| |||
1775 | 1742 | | |
1776 | 1743 | | |
1777 | 1744 | | |
1778 | | - | |
1779 | | - | |
1780 | | - | |
1781 | 1745 | | |
1782 | | - | |
| 1746 | + | |
1783 | 1747 | | |
1784 | 1748 | | |
1785 | 1749 | | |
| |||
1842 | 1806 | | |
1843 | 1807 | | |
1844 | 1808 | | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
| 1809 | + | |
1848 | 1810 | | |
1849 | | - | |
| 1811 | + | |
1850 | 1812 | | |
1851 | 1813 | | |
1852 | 1814 | | |
| |||
1934 | 1896 | | |
1935 | 1897 | | |
1936 | 1898 | | |
1937 | | - | |
| 1899 | + | |
1938 | 1900 | | |
1939 | 1901 | | |
1940 | 1902 | | |
| |||
0 commit comments