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

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