]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rbd: treat zero-byte object maps as missing
authorJason Dillaman <dillaman@redhat.com>
Fri, 20 Mar 2015 03:29:44 +0000 (23:29 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 10 Apr 2015 18:10:05 +0000 (14:10 -0400)
Acquiring the lock on a missing object map will create an
empty object. Treat the empty object as a non-existant
object map to support rebuilding corrupt object maps while
holding the exclusive lock.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/cls/rbd/cls_rbd.cc

index 6bd5999060d1d55bf2351f705a7030a95e30156e..ef18c6ea08bb81774ccfb082a9e0a5aeb7b7620d 100644 (file)
@@ -1985,6 +1985,9 @@ int object_map_read(cls_method_context_t hctx, BitVector<2> &object_map)
   if (r < 0) {
     return r;
   }
+  if (size == 0) {
+    return -ENOENT;
+  }
 
   bufferlist bl;
   r = cls_cxx_read(hctx, 0, size, &bl);