From: Jason Dillaman Date: Fri, 20 Mar 2015 03:29:44 +0000 (-0400) Subject: cls_rbd: treat zero-byte object maps as missing X-Git-Tag: v9.0.1~149^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1b7f8c13f9c4bd2b10dc419d08915c017af49616;p=ceph.git cls_rbd: treat zero-byte object maps as missing 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 --- diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index 6bd5999060d1..ef18c6ea08bb 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -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);