Fixes: https://tracker.ceph.com/issues/38006
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit
3d01cc627137d7f270969653fbae4b6230361d7a)
Conflicts:
- src/librbd/api/Trash.cc
- src/tools/rbd/action/Trash.cc
In mimic, the code that needs fixing was in
'tools/rbd/action/Trash.cc'.
return r;
}
- std::remove_if(trash_entries.begin(), trash_entries.end(),
- [](librbd::trash_image_info_t info) {
- return info.source != RBD_TRASH_IMAGE_SOURCE_USER;
- }
- );
+ trash_entries.erase(
+ std::remove_if(trash_entries.begin(), trash_entries.end(),
+ [](librbd::trash_image_info_t info) {
+ return info.source != RBD_TRASH_IMAGE_SOURCE_USER;
+ }),
+ trash_entries.end());
std::vector<const char *> to_be_removed;