Skip to content

Commit

Permalink
librbd: do not return a failure if a peer cannot be notified of updat…
Browse files Browse the repository at this point in the history
…eReviewed-by: Josh Durgin <jdurgin@redhat.com>

librbd: do not return a failure if a peer cannot be notified of update

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
jdurgin committed Apr 14, 2016
2 parents 6956da8 + 8087cfa commit 9ecf3bc
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/librbd/Operations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9ecf3bc

Please sign in to comment.