]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: return error when r < 0
authorsongweibin <song.weibin@zte.com.cn>
Mon, 2 Apr 2018 03:09:26 +0000 (11:09 +0800)
committersongweibin <song.weibin@zte.com.cn>
Mon, 2 Apr 2018 03:09:26 +0000 (11:09 +0800)
Signed-off-by: songweibin <song.weibin@zte.com.cn>
src/librbd/api/Group.cc

index 99fea4a568da375f9d906e406d0aa9488814bdfe..1b2d3f46cff6c8d0fd7913cc93d1b774c52a7bec 100644 (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);