From: Sage Weil Date: Mon, 16 Nov 2015 16:32:34 +0000 (-0500) Subject: osdc/Objecter: call notify completion only once X-Git-Tag: v0.94.7~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7992%2Fhead;p=ceph.git osdc/Objecter: call notify completion only once If we race with a reconnect we could get a second notify message before the notify linger op is torn down. Ensure we only ever call the notify completion once to prevent a segfault. Fixes: #13805 Signed-off-by: Sage Weil (cherry picked from commit 987f68a8df292668ad241f4769d82792644454dd) --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 2b5a979f823..9bdbe5aafa9 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -801,10 +801,13 @@ void Objecter::handle_watch_notify(MWatchNotify *m) info->notify_id != m->notify_id) { ldout(cct, 10) << __func__ << " reply notify " << m->notify_id << " != " << info->notify_id << ", ignoring" << dendl; - } else { - assert(info->on_notify_finish); + } else if (info->on_notify_finish) { info->notify_result_bl->claim(m->get_data()); info->on_notify_finish->complete(m->return_code); + + // if we race with reconnect we might get a second notify; only + // notify the caller once! + info->on_notify_finish = NULL; } } else { finisher->queue(new C_DoWatchNotify(this, info, m));