From: Zhiqiang Wang Date: Fri, 17 Apr 2015 07:15:54 +0000 (+0800) Subject: librbd: don't notify_change on error when notify async complete X-Git-Tag: v9.0.1~19^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=63eb4326dbfc7217dce7f235d3f43e263a1a5147;p=ceph.git librbd: don't notify_change on error when notify async complete Don't need to increment the refresh_seq since the async op fails. Signed-off-by: Zhiqiang Wang --- diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index a493bd518644..12bc5983c095 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -427,8 +427,10 @@ int ImageWatcher::notify_async_complete(const AsyncRequestId &request, bufferlist bl; ::encode(NotifyMessage(AsyncCompletePayload(request, r)), bl); - librbd::notify_change(m_image_ctx.md_ctx, m_image_ctx.header_oid, - &m_image_ctx); + if (r >= 0) { + librbd::notify_change(m_image_ctx.md_ctx, m_image_ctx.header_oid, + &m_image_ctx); + } int ret = m_image_ctx.md_ctx.notify2(m_image_ctx.header_oid, bl, NOTIFY_TIMEOUT, NULL); if (ret < 0) {