From: Jason Dillaman Date: Wed, 19 Oct 2016 16:03:37 +0000 (-0400) Subject: librbd: exclusive lock incorrectly initialized when switching to HEAD X-Git-Tag: v10.2.6~36^2~24^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11852%2Fhead;p=ceph.git librbd: exclusive lock incorrectly initialized when switching to HEAD Fixes: http://tracker.ceph.com/issues/17618 Signed-off-by: Jason Dillaman (cherry picked from commit 039716db053f91a8ee52d669cbe992d95af6a6c6) --- diff --git a/src/librbd/image/SetSnapRequest.cc b/src/librbd/image/SetSnapRequest.cc index e00ebeb4ac6b..50d485ce54e7 100644 --- a/src/librbd/image/SetSnapRequest.cc +++ b/src/librbd/image/SetSnapRequest.cc @@ -56,7 +56,8 @@ void SetSnapRequest::send_init_exclusive_lock() { } } - if (!m_image_ctx.test_features(RBD_FEATURE_EXCLUSIVE_LOCK)) { + if (m_image_ctx.read_only || + !m_image_ctx.test_features(RBD_FEATURE_EXCLUSIVE_LOCK)) { int r = 0; if (send_refresh_parent(&r) != nullptr) { send_complete();