From: Jason Dillaman Date: Tue, 12 Apr 2016 00:58:50 +0000 (-0400) Subject: librbd: do not return a failure if a peer cannot be notified of update X-Git-Tag: ses3-milestone4~15^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8543%2Fhead;p=ceph.git librbd: do not return a failure if a peer cannot be notified of update Maintenance ops that fail to notify a peer of the update should not report a failure to the original user. Fixes: http://tracker.ceph.com/issues/15351 Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/Operations.cc b/src/librbd/Operations.cc index f8151c9d3a02..81219d4a745a 100644 --- a/src/librbd/Operations.cc +++ b/src/librbd/Operations.cc @@ -41,12 +41,28 @@ struct C_NotifyUpdate : public Context { } virtual void complete(int r) override { - if (r < 0 || notified) { + CephContext *cct = image_ctx.cct; + if (notified) { + if (r == -ETIMEDOUT) { + // don't fail the op if a peer fails to get the update notification + lderr(cct) << "update notification timed-out" << dendl; + r = 0; + } else if (r < 0) { + lderr(cct) << "update notification failed: " << cpp_strerror(r) + << dendl; + } Context::complete(r); - } else { - notified = true; - image_ctx.notify_update(this); + return; } + + if (r < 0) { + // op failed -- no need to send update notification + Context::complete(r); + return; + } + + notified = true; + image_ctx.notify_update(this); } virtual void finish(int r) override { on_finish->complete(r);