From 63eb4326dbfc7217dce7f235d3f43e263a1a5147 Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Fri, 17 Apr 2015 15:15:54 +0800 Subject: [PATCH] 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 --- src/librbd/ImageWatcher.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) { -- 2.47.3