From: Jason Dillaman Date: Wed, 22 Jun 2016 14:14:21 +0000 (-0400) Subject: rbd-mirror: block proxied ops with -EROFS return code X-Git-Tag: v11.0.0~62^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F9867%2Fhead;p=ceph.git rbd-mirror: block proxied ops with -EROFS return code 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 --- diff --git a/src/tools/rbd_mirror/image_replayer/OpenLocalImageRequest.cc b/src/tools/rbd_mirror/image_replayer/OpenLocalImageRequest.cc index 9367ed6dfa96..35b6863098b4 100644 --- a/src/tools/rbd_mirror/image_replayer/OpenLocalImageRequest.cc +++ b/src/tools/rbd_mirror/image_replayer/OpenLocalImageRequest.cc @@ -141,6 +141,9 @@ void OpenLocalImageRequest::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, &OpenLocalImageRequest::handle_lock_image>( this);