]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: block proxied ops with -EROFS return code 9867/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 22 Jun 2016 14:14:21 +0000 (10:14 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 22 Jun 2016 14:14:21 +0000 (10:14 -0400)
When replicating to a local image, the daemon will own the
exclusive lock and will receive any proxied maintenance ops
from other clients. Since the image is non-primary, respond
with -EROFS.

Fixes: http://tracker.ceph.com/issues/16411
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd_mirror/image_replayer/OpenLocalImageRequest.cc

index 9367ed6dfa96c4274fe88bdd5e5150abbe6ae477..35b6863098b46d56e8c4bba41610f12e4acadcc3 100644 (file)
@@ -141,6 +141,9 @@ void OpenLocalImageRequest<I>::send_lock_image() {
     return;
   }
 
+  // disallow any proxied maintenance operations before grabbing lock
+  (*m_local_image_ctx)->exclusive_lock->block_requests(-EROFS);
+
   Context *ctx = create_context_callback<
     OpenLocalImageRequest<I>, &OpenLocalImageRequest<I>::handle_lock_image>(
       this);