]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: get_parent_info should protect against invalid parent
authorJason Dillaman <dillaman@redhat.com>
Mon, 16 Mar 2015 22:35:07 +0000 (18:35 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 1 Apr 2015 19:53:46 +0000 (15:53 -0400)
get_parent_info should return -ENOENT if the image does not
have an associated parent image.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 21afd0ef8e1fb81c5ace5fd403513c542e2413e3)

src/librbd/internal.cc

index 598d515cde4a409462d00f49da984c42b2b1ba64..e382999910a7d062ef0d61295a6e56352bb61edb 100644 (file)
@@ -1323,6 +1323,9 @@ reprotect_and_return_err:
 
     RWLock::RLocker l(ictx->snap_lock);
     RWLock::RLocker l2(ictx->parent_lock);
+    if (ictx->parent == NULL) {
+      return -ENOENT;
+    }
 
     parent_spec parent_spec;