From 1b7d2fe64e0982b6bda927fc70ab69689b55d70a Mon Sep 17 00:00:00 2001 From: songweibin Date: Mon, 2 Apr 2018 11:09:26 +0800 Subject: [PATCH] librbd: return error when r < 0 Signed-off-by: songweibin --- src/librbd/api/Group.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librbd/api/Group.cc b/src/librbd/api/Group.cc index 99fea4a568d..1b2d3f46cff 100644 --- a/src/librbd/api/Group.cc +++ b/src/librbd/api/Group.cc @@ -398,6 +398,10 @@ int Group::remove(librados::IoCtx& io_ctx, const char *group_name) std::vector 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);