Blame SOURCES/kvm-file-posix-Fix-shared-locks-on-reopen-commit.patch

7711c0
From ef27c0164bee4e910d0f2e20928688f873d924a3 Mon Sep 17 00:00:00 2001
7711c0
From: Max Reitz <mreitz@redhat.com>
7711c0
Date: Mon, 4 Feb 2019 20:42:06 +0100
7711c0
Subject: [PATCH 06/33] file-posix: Fix shared locks on reopen commit
7711c0
7711c0
RH-Author: Max Reitz <mreitz@redhat.com>
7711c0
Message-id: <20190204204207.18079-7-mreitz@redhat.com>
7711c0
Patchwork-id: 84225
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 6/7] file-posix: Fix shared locks on reopen commit
7711c0
Bugzilla: 1551486
7711c0
RH-Acked-by: John Snow <jsnow@redhat.com>
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
7711c0
7711c0
s->locked_shared_perm is the set of bits locked in the file, which is
7711c0
the inverse of the permissions actually shared.  So we need to pass them
7711c0
as they are to raw_apply_lock_bytes() instead of inverting them again.
7711c0
7711c0
Reported-by: Alberto Garcia <berto@igalia.com>
7711c0
Signed-off-by: Max Reitz <mreitz@redhat.com>
7711c0
Reviewed-by: Alberto Garcia <berto@igalia.com>
7711c0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7711c0
(cherry picked from commit 577a133988c76e4ebf01d050d0d758d207a1baf7)
7711c0
Signed-off-by: Max Reitz <mreitz@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 block/file-posix.c | 2 +-
7711c0
 1 file changed, 1 insertion(+), 1 deletion(-)
7711c0
7711c0
diff --git a/block/file-posix.c b/block/file-posix.c
7711c0
index 97e7ff2..deecf58 100644
7711c0
--- a/block/file-posix.c
7711c0
+++ b/block/file-posix.c
7711c0
@@ -929,7 +929,7 @@ static void raw_reopen_commit(BDRVReopenState *state)
7711c0
 
7711c0
     /* Copy locks to the new fd before closing the old one. */
7711c0
     raw_apply_lock_bytes(NULL, rs->fd, s->locked_perm,
7711c0
-                         ~s->locked_shared_perm, false, &local_err);
7711c0
+                         s->locked_shared_perm, false, &local_err);
7711c0
     if (local_err) {
7711c0
         /* shouldn't fail in a sane host, but report it just in case. */
7711c0
         error_report_err(local_err);
7711c0
-- 
7711c0
1.8.3.1
7711c0