]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: don't assert if get_omap_iterator() returns NULL
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 8 May 2013 19:18:49 +0000 (12:18 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Wed, 8 May 2013 19:20:38 +0000 (12:20 -0700)
Fixes: #4949
This can happen if the object does not exist and it's
a write operation. Just return -ENOENT.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/osd/ReplicatedPG.cc

index 85b62662ac93b598946e09fc86e915a2d493f649..4e396c324f7caf9166fd43ed1b9781283358ce92 100644 (file)
@@ -2922,7 +2922,10 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          ObjectMap::ObjectMapIterator iter = osd->store->get_omap_iterator(
            coll, soid
            );
-         assert(iter);
+          if (!iter) {
+            result = -ENOENT;
+            goto fail;
+          }
          iter->upper_bound(start_after);
          if (filter_prefix >= start_after) iter->lower_bound(filter_prefix);
          for (uint64_t i = 0;