summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Farnum <greg@inktank.com>2013-03-26 14:21:54 -0700
committerGreg Farnum <greg@inktank.com>2013-09-19 18:15:00 -0700
commitc2934655dd9bee85806e0c418544f89eb915c88a (patch)
treea1aefd18d75b778266f42d4e6bb3cc2cb07e4849
parent06e1bcadfe30cfd8850f6f5d30138a7998fa4130 (diff)
downloadceph-c2934655dd9bee85806e0c418544f89eb915c88a.tar.gz
osd: change how we work around an interface limitation.
If this had ever actually been triggered we would have hit an assert in the OpRequest destructor that op->request is non-NULL. Signed-off-by: Greg Farnum <greg@inktank.com>
-rw-r--r--src/osd/OSD.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index 5b448a5ccb9..da7e138227d 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -5927,11 +5927,16 @@ void OSD::handle_pg_create(OpRequestRef op)
}
}
- if (!require_mon_peer(op->request)) {
- // we have to hack around require_mon_peer's interface limits
- op->request = NULL;
+ /* we have to hack around require_mon_peer's interface limits, so
+ * grab an extra reference before going in. If the peer isn't
+ * a Monitor, the reference is put for us (and then cleared
+ * up automatically by our OpTracker infrastructure). Otherwise,
+ * we put the extra ref ourself.
+ */
+ if (!require_mon_peer(op->request->get())) {
return;
}
+ op->request->put();
if (!require_same_or_newer_map(op, m->epoch)) return;