From 20ae76be34b9c992476921e994707c5f31a17599 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 19 Oct 2016 12:03:37 -0400 Subject: [PATCH] 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) --- src/librbd/image/SetSnapRequest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librbd/image/SetSnapRequest.cc b/src/librbd/image/SetSnapRequest.cc index e00ebeb4ac6b3..50d485ce54e72 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(); -- 2.39.5