From: xie xingguo Date: Mon, 11 Jan 2016 10:25:07 +0000 (+0800) Subject: RBD: fix unhandle result code during list/list_children X-Git-Tag: v10.0.3~60^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bbb89c760095b1aef692b5b15d0450d226971fdc;p=ceph.git RBD: fix unhandle result code during list/list_children Fixes: #14333 Signed-off-by: xie xingguo --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 9368bceed476..958be93de5cf 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -677,8 +677,13 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) { string last_read = ""; do { map images; - cls_client::dir_list(&io_ctx, RBD_DIRECTORY, + r = cls_client::dir_list(&io_ctx, RBD_DIRECTORY, last_read, max_read, &images); + if (r < 0) { + lderr(cct) << "error listing image in directory: " + << cpp_strerror(r) << dendl; + return r; + } for (map::const_iterator it = images.begin(); it != images.end(); ++it) { names.push_back(it->first); @@ -711,7 +716,11 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) { // search all pools for children depending on this snapshot Rados rados(ictx->md_ctx); std::list > pools; - rados.pool_list2(pools); + r = rados.pool_list2(pools); + if (r < 0) { + lderr(cct) << "error listing pools: " << cpp_strerror(r) << dendl; + return r; + } for (std::list >::const_iterator it = pools.begin(); it != pools.end(); ++it) {