]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: exclusive lock incorrectly initialized when switching to HEAD 11852/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 19 Oct 2016 16:03:37 +0000 (12:03 -0400)
committerLoic Dachary <ldachary@redhat.com>
Wed, 9 Nov 2016 12:18:42 +0000 (13:18 +0100)
Fixes: http://tracker.ceph.com/issues/17618
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 039716db053f91a8ee52d669cbe992d95af6a6c6)

src/librbd/image/SetSnapRequest.cc

index e00ebeb4ac6b3cf418cc6b3d3e9a7dd67efb876f..50d485ce54e72b434b23c4c06f96337500d30e6f 100644 (file)
@@ -56,7 +56,8 @@ void SetSnapRequest<I>::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();