librbd: return error when r < 0

Signed-off-by: songweibin <song.weibin@zte.com.cn>
This commit is contained in:
songweibin 2018-04-02 11:09:26 +08:00
parent 5539309996
commit 1b7d2fe64e

View File

@ -398,6 +398,10 @@ int Group<I>::remove(librados::IoCtx& io_ctx, const char *group_name)
std::vector<cls::rbd::GroupSnapshot> snaps;
r = group_snap_list(io_ctx, group_name, &snaps);
if (r < 0 && r != -ENOENT) {
lderr(cct) << "error listing group snapshots" << dendl;
return r;
}
for (auto &snap : snaps) {
r = group_snap_remove_by_record(io_ctx, snap, group_id, group_header_oid);