From 2e9125c32b2e9ae549a01c28fbe42d7406935e82 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Wed, 14 Jun 2023 14:56:30 +0200 Subject: [PATCH] virtiofsd: Drop `-o no_posix_lock` The C implementation of virtiofsd had some kind of limited support for remote POSIX locks that was causing some workflows to fail with kata. Commit 432f9bea6e8b2 hard coded `-o no_posix_lock` in order to enforce guest local POSIX locks and avoid the issues. We've switched to the rust implementation of virtiofsd since then, but it emits a warning about `-o` being deprecated. According to https://gitlab.com/virtio-fs/virtiofsd/-/issues/53 : The C implementation of the daemon has limited support for remote POSIX locks, restricted exclusively to non-blocking operations. We tried to implement the same level of functionality in #2, but we finally decided against it because, in practice most applications will fail if non-blocking operations aren't supported. Implementing support for non-blocking isn't trivial and will probably require extending the kernel interface before we can even start working on the daemon side. There is thus no justification to pass `-o no_posix_lock` anymore. Signed-off-by: Greg Kurz (cherry picked from commit 8e00dc694416d1bd962d130de3f1fa42737233f6) Signed-off-by: Greg Kurz --- src/runtime/virtcontainers/virtiofsd.go | 3 --- src/runtime/virtcontainers/virtiofsd_test.go | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/runtime/virtcontainers/virtiofsd.go b/src/runtime/virtcontainers/virtiofsd.go index bb5aaa319e..d45c08dca4 100644 --- a/src/runtime/virtcontainers/virtiofsd.go +++ b/src/runtime/virtcontainers/virtiofsd.go @@ -187,9 +187,6 @@ func (v *virtiofsd) args(FdSocketNumber uint) ([]string, error) { "--syslog", // cache mode for virtiofsd "-o", "cache=" + v.cache, - // disable posix locking in daemon: bunch of basic posix locks properties are broken - // apt-get update is broken if enabled - "-o", "no_posix_lock", // shared directory tree "-o", "source=" + v.sourcePath, // fd number of vhost-user socket diff --git a/src/runtime/virtcontainers/virtiofsd_test.go b/src/runtime/virtcontainers/virtiofsd_test.go index 2fd096b380..fbcdbec276 100644 --- a/src/runtime/virtcontainers/virtiofsd_test.go +++ b/src/runtime/virtcontainers/virtiofsd_test.go @@ -79,12 +79,12 @@ func TestVirtiofsdArgs(t *testing.T) { cache: "none", } - expected := "--syslog -o cache=none -o no_posix_lock -o source=/run/kata-shared/foo --fd=123" + expected := "--syslog -o cache=none -o source=/run/kata-shared/foo --fd=123" args, err := v.args(123) assert.NoError(err) assert.Equal(expected, strings.Join(args, " ")) - expected = "--syslog -o cache=none -o no_posix_lock -o source=/run/kata-shared/foo --fd=456" + expected = "--syslog -o cache=none -o source=/run/kata-shared/foo --fd=456" args, err = v.args(456) assert.NoError(err) assert.Equal(expected, strings.Join(args, " "))