diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-05-08 12:18:49 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-05-08 12:20:38 -0700 |
commit | 546ed917fb3e76fef090492f3b8c322897aa4ed9 (patch) | |
tree | 8048fff20dea0472a629e9fe5e3ec2f66dd1e57b | |
parent | 76b736b33708c78cbe4200f1483a8517d8b5b501 (diff) | |
download | ceph-546ed917fb3e76fef090492f3b8c322897aa4ed9.tar.gz |
osd: don't assert if get_omap_iterator() returns NULL
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>
-rw-r--r-- | src/osd/ReplicatedPG.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 85b62662ac9..4e396c324f7 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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; |