Blame SOURCES/kvm-luks-Allow-share-rw-on.patch

7711c0
From baa218a4170b17e3699272a481ee04616c9432f0 Mon Sep 17 00:00:00 2001
7711c0
From: Max Reitz <mreitz@redhat.com>
7711c0
Date: Mon, 4 Feb 2019 21:08:22 +0100
7711c0
Subject: [PATCH 8/8] luks: Allow share-rw=on
7711c0
MIME-Version: 1.0
7711c0
Content-Type: text/plain; charset=UTF-8
7711c0
Content-Transfer-Encoding: 8bit
7711c0
7711c0
RH-Author: Max Reitz <mreitz@redhat.com>
7711c0
Message-id: <20190204210822.10343-2-mreitz@redhat.com>
7711c0
Patchwork-id: 84228
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 1/1] luks: Allow share-rw=on
7711c0
Bugzilla: 1598119
7711c0
RH-Acked-by: John Snow <jsnow@redhat.com>
7711c0
RH-Acked-by: Yash Mankad <ymankad@redhat.com>
7711c0
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
7711c0
7711c0
From: Fam Zheng <famz@redhat.com>
7711c0
7711c0
Format drivers such as qcow2 don't allow sharing the same image between
7711c0
two QEMU instances in order to prevent image corruptions, because of
7711c0
metadata cache. LUKS driver don't modify metadata except for when
7711c0
creating image, so it is safe to relax the permission. This makes
7711c0
share-rw=on property work on virtual devices.
7711c0
7711c0
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
7711c0
Signed-off-by: Fam Zheng <famz@redhat.com>
7711c0
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7711c0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7711c0
(cherry picked from commit 497da8236ab2663a8108858ba7ea59aac21c5fe6)
7711c0
Signed-off-by: Max Reitz <mreitz@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 block/crypto.c | 4 +++-
7711c0
 1 file changed, 3 insertions(+), 1 deletion(-)
7711c0
7711c0
diff --git a/block/crypto.c b/block/crypto.c
7711c0
index 02f04f3..0bb0db6 100644
7711c0
--- a/block/crypto.c
7711c0
+++ b/block/crypto.c
7711c0
@@ -698,7 +698,9 @@ BlockDriver bdrv_crypto_luks = {
7711c0
     .bdrv_probe         = block_crypto_probe_luks,
7711c0
     .bdrv_open          = block_crypto_open_luks,
7711c0
     .bdrv_close         = block_crypto_close,
7711c0
-    .bdrv_child_perm    = bdrv_format_default_perms,
7711c0
+    /* This driver doesn't modify LUKS metadata except when creating image.
7711c0
+     * Allow share-rw=on as a special case. */
7711c0
+    .bdrv_child_perm    = bdrv_filter_default_perms,
7711c0
     .bdrv_co_create     = block_crypto_co_create_luks,
7711c0
     .bdrv_co_create_opts = block_crypto_co_create_opts_luks,
7711c0
     .bdrv_co_truncate   = block_crypto_co_truncate,
7711c0
-- 
7711c0
1.8.3.1
7711c0