thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-virtiofsd-Disable-remote-posix-locks-by-default.patch

6e7d01
From 3ec945ba7c2649cca13cf6070c6365b1262ad1ec Mon Sep 17 00:00:00 2001
6e7d01
From: Max Reitz <mreitz@redhat.com>
6e7d01
Date: Fri, 6 Aug 2021 11:58:26 -0400
6e7d01
Subject: [PATCH 1/2] virtiofsd: Disable remote posix locks by default
6e7d01
MIME-Version: 1.0
6e7d01
Content-Type: text/plain; charset=UTF-8
6e7d01
Content-Transfer-Encoding: 8bit
6e7d01
6e7d01
RH-Author: Max Reitz <mreitz@redhat.com>
6e7d01
Message-id: <20210806115827.740945-2-mreitz@redhat.com>
6e7d01
Patchwork-id: 101970
6e7d01
O-Subject: [RHEL-8.5.0 qemu-kvm PATCH 1/2] virtiofsd: Disable remote posix locks by default
6e7d01
Bugzilla: 1967496
6e7d01
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
6e7d01
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
6e7d01
RH-Acked-by: Vivek Goyal <vgoyal@redhat.com>
6e7d01
6e7d01
From: Vivek Goyal <vgoyal@redhat.com>
6e7d01
6e7d01
Right now we enable remote posix locks by default. That means when guest
6e7d01
does a posix lock it sends request to server (virtiofsd). But currently
6e7d01
we only support non-blocking posix lock and return -EOPNOTSUPP for
6e7d01
blocking version.
6e7d01
6e7d01
This means that existing applications which are doing blocking posix
6e7d01
locks get -EOPNOTSUPP and fail. To avoid this, people have been
6e7d01
running virtiosd with option "-o no_posix_lock". For new users it
6e7d01
is still a surprise and trial and error takes them to this option.
6e7d01
6e7d01
Given posix lock implementation is not complete in virtiofsd, disable
6e7d01
it by default. This means that posix locks will work with-in applications
6e7d01
in a guest but not across guests. Anyway we don't support sharing
6e7d01
filesystem among different guests yet in virtiofs so this should
6e7d01
not lead to any kind of surprise or regression and will make life
6e7d01
little easier for virtiofs users.
6e7d01
6e7d01
Reported-by: Aa Aa <jimbothom@yandex.com>
6e7d01
Suggested-by: Miklos Szeredi <mszeredi@redhat.com>
6e7d01
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
6e7d01
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
6e7d01
Reviewed-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
6e7d01
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6e7d01
(cherry picked from commit 88fc107956a5812649e5918e0c092d3f78bb28ad)
6e7d01
6e7d01
Conflicts:
6e7d01
	docs/tools/virtiofsd.rst
6e7d01
	We do not have virtiofsd.rst downstream (added upstream in
6e7d01
	commit 6a7e2bbee5fa), so I dropped that hunk (which effectively
6e7d01
	updated the default value in the man page).
6e7d01
6e7d01
Signed-off-by: Max Reitz <mreitz@redhat.com>
6e7d01
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
6e7d01
---
6e7d01
 tools/virtiofsd/passthrough_ll.c | 2 +-
6e7d01
 1 file changed, 1 insertion(+), 1 deletion(-)
6e7d01
6e7d01
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
6e7d01
index cb0992f2db..b47029da89 100644
6e7d01
--- a/tools/virtiofsd/passthrough_ll.c
6e7d01
+++ b/tools/virtiofsd/passthrough_ll.c
6e7d01
@@ -3001,7 +3001,7 @@ int main(int argc, char *argv[])
6e7d01
     struct lo_data lo = {
6e7d01
         .debug = 0,
6e7d01
         .writeback = 0,
6e7d01
-        .posix_lock = 1,
6e7d01
+        .posix_lock = 0,
6e7d01
         .proc_self_fd = -1,
6e7d01
     };
6e7d01
     struct lo_map_elem *root_elem;
6e7d01
-- 
6e7d01
2.27.0
6e7d01