]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: error closing image while set to invalid snapshot 5647/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 24 Aug 2015 14:58:52 +0000 (10:58 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 24 Aug 2015 15:02:10 +0000 (11:02 -0400)
With cache disabled, closing the image will result in a flush
which might result in the image being refreshed.  If this happens
while the image is set to an invalid snapshot, an error will be
returned while closing the image.

Fixes: #12765
Backport: infernalis
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/internal.cc

index e1bccdc516dd5a4625ea658e123d9292754aa956..8b9f3b9dc4573cb887c11db954723d72de0bfad3 100644 (file)
@@ -2140,11 +2140,12 @@ reprotect_and_return_err:
     if (ictx->parent) {
       uint64_t overlap;
       r = ictx->get_parent_overlap(ictx->snap_id, &overlap);
-      if (r < 0)
+      if (r < 0 && r != -ENOENT) {
        return r;
-      if (!overlap ||
+      }
+      if (r == -ENOENT || overlap == 0 ||
          ictx->parent->md_ctx.get_id() !=
-         ictx->get_parent_pool_id(ictx->snap_id) ||
+            ictx->get_parent_pool_id(ictx->snap_id) ||
          ictx->parent->id != ictx->get_parent_image_id(ictx->snap_id) ||
          ictx->parent->snap_id != ictx->get_parent_snap_id(ictx->snap_id)) {
        ictx->clear_nonexistence_cache();