Commit 479014e
committed
librbd/api/Mirror: return EINVAL from image_get_mode()
... when the image is disabled for mirroring.
When an image is disabled for mirroring, fetching the image's
mirroring mode is invalid. So, modify the Mirror::image_get_mode()
internal API to return EINVAL instead of success when mirroring is
disabled.
The Mirror::image_get_mode() method is called by the public C++, C, and
Python APIs that fetch the mirroring mode of an image. The behavior of
these public APIs will change. They will return an error code or raise
an exception indicating that it's an invalid operation to fetch the
image's mirroring mode when mirroring is disabled.
Fixes: https://tracker.ceph.com/issues/71226
Signed-off-by: Ramana Raja <[email protected]>1 parent 268966a commit 479014e
File tree
5 files changed
+92
-23
lines changed- src
- librbd/api
- test
- librbd
- pybind
5 files changed
+92
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
158 | 163 | | |
159 | 164 | | |
160 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
320 | 319 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 320 | + | |
| 321 | + | |
325 | 322 | | |
326 | 323 | | |
327 | 324 | | |
| 325 | + | |
| 326 | + | |
328 | 327 | | |
329 | 328 | | |
330 | 329 | | |
331 | 330 | | |
332 | 331 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
345 | 337 | | |
346 | 338 | | |
347 | 339 | | |
| |||
357 | 349 | | |
358 | 350 | | |
359 | 351 | | |
360 | | - | |
| 352 | + | |
361 | 353 | | |
362 | 354 | | |
363 | 355 | | |
| |||
384 | 376 | | |
385 | 377 | | |
386 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
387 | 409 | | |
388 | 410 | | |
389 | 411 | | |
| |||
858 | 880 | | |
859 | 881 | | |
860 | 882 | | |
861 | | - | |
| 883 | + | |
862 | 884 | | |
863 | 885 | | |
864 | 886 | | |
| |||
895 | 917 | | |
896 | 918 | | |
897 | 919 | | |
898 | | - | |
| 920 | + | |
899 | 921 | | |
900 | 922 | | |
901 | 923 | | |
| |||
924 | 946 | | |
925 | 947 | | |
926 | 948 | | |
927 | | - | |
| 949 | + | |
928 | 950 | | |
929 | 951 | | |
930 | 952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11338 | 11338 | | |
11339 | 11339 | | |
11340 | 11340 | | |
| 11341 | + | |
| 11342 | + | |
| 11343 | + | |
| 11344 | + | |
| 11345 | + | |
| 11346 | + | |
| 11347 | + | |
11341 | 11348 | | |
11342 | 11349 | | |
11343 | 11350 | | |
| |||
11358 | 11365 | | |
11359 | 11366 | | |
11360 | 11367 | | |
| 11368 | + | |
| 11369 | + | |
| 11370 | + | |
| 11371 | + | |
| 11372 | + | |
| 11373 | + | |
| 11374 | + | |
| 11375 | + | |
11361 | 11376 | | |
11362 | 11377 | | |
11363 | 11378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2678 | 2678 | | |
2679 | 2679 | | |
2680 | 2680 | | |
| 2681 | + | |
2681 | 2682 | | |
2682 | 2683 | | |
2683 | 2684 | | |
| |||
2835 | 2836 | | |
2836 | 2837 | | |
2837 | 2838 | | |
2838 | | - | |
2839 | 2839 | | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
2840 | 2864 | | |
2841 | 2865 | | |
2842 | 2866 | | |
2843 | 2867 | | |
2844 | 2868 | | |
2845 | 2869 | | |
2846 | | - | |
2847 | 2870 | | |
2848 | 2871 | | |
2849 | 2872 | | |
| |||
0 commit comments