librbd: propagate ENOENT for non-existent groups and images
Calling `list_images()` on a non-existent group falsely succeeded and returned an empty iterator.This happened because `Group<I>::image_list` ignored the negative error code returned by `group_image_list`, allowing execution to proceed blindly. Furthermore, the C API `rbd_group_image_list` intercepted `-ENOENT` and forced a success (0) return value. Similarly other public C APIs `rbd_snap_list` and `rbd_group_snap_list` also intercepts -ENOENT and forces a success (0) return value which is incorrect. Fix these behavior by: - Propagating errors properly inside `Group<I>::image_list`. - Removing the incorrect `-ENOENT` masking in `rbd_group_image_list`, `rbd_snap_list`, rbd_group_snap_list` Now `list_images()` consistently raise an `ObjectNotFound` error when invoked on a non-existent group and public C APIs propagate ENOENT without masking it into 0. Also Extended the `TestGroups` test fixture with `self.dne_group` to validate the expected error paths across all relevant APIs. Fixes: https://tracker.ceph.com/issues/78108 Signed-off-by: VinayBhaskar-V <vvarada@redhat.com>
V
VinayBhaskar-V committed
c4c937d81c228c0f242ad4e8478064bafd4281c0
Parent: e677c76