From: Jason Dillaman Date: Fri, 15 Dec 2017 00:04:33 +0000 (-0500) Subject: rbd: 'trash list --long' will return a failure on non-cloned images X-Git-Tag: v13.0.2~770^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F19540%2Fhead;p=ceph.git rbd: 'trash list --long' will return a failure on non-cloned images Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd/action/Trash.cc b/src/tools/rbd/action/Trash.cc index d46cfe2b9de..85f976c0c38 100644 --- a/src/tools/rbd/action/Trash.cc +++ b/src/tools/rbd/action/Trash.cc @@ -234,12 +234,14 @@ int do_list(librbd::RBD &rbd, librados::IoCtx& io_ctx, bool long_flag, std::string time_str = ctime(&entry.deletion_time); time_str = time_str.substr(0, time_str.length() - 1); + bool has_parent = false; std::string pool, image, snap, parent; r = im.parent_info(&pool, &image, &snap); - if (r < 0 && r != -ENOENT) + if (r == -ENOENT) { + r = 0; + } else if (r < 0) { return r; - bool has_parent = false; - if (r != -ENOENT) { + } else { parent = pool + "/" + image + "@" + snap; has_parent = true; }