]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: 'trash list --long' will return a failure on non-cloned images 19540/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 15 Dec 2017 00:04:33 +0000 (19:04 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 15 Dec 2017 14:06:37 +0000 (09:06 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd/action/Trash.cc

index d46cfe2b9de3b37db17099273ec9c6ff7d808dc1..85f976c0c3817f7736e80eb91e0a560ee04806ff 100644 (file)
@@ -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;
     }