diff --git a/kata-containers.spec b/kata-containers.spec index 9675496238980decfcb57748de11e6e2bbebd53e..d25f2e58efb6d3710ca50df8c20e2ef1485cbebd 100644 --- a/kata-containers.spec +++ b/kata-containers.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} %define VERSION 3.2.0 -%define RELEASE 7 +%define RELEASE 8 Name: kata-containers Version: %{VERSION} @@ -117,6 +117,12 @@ strip %{buildroot}/usr/bin/containerd-shim-kata-v2 %doc %changelog +* Wed Jul 2 2025 dongyuzhen - 3.2.0-8 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:runtime: 9p use cache=none + * Fri Jun 6 2025 dongyuzhen - 3.2.0-7 - Type:bugfix - ID:NA diff --git a/patches/0009-kata-runtime-9p-use-cache-none.patch b/patches/0009-kata-runtime-9p-use-cache-none.patch new file mode 100644 index 0000000000000000000000000000000000000000..7437556a30bcab8c513a95e359244d9fee90986f --- /dev/null +++ b/patches/0009-kata-runtime-9p-use-cache-none.patch @@ -0,0 +1,33 @@ +From bf079d9ca578afdc0257e0b42f03d9bb0d7b695b Mon Sep 17 00:00:00 2001 +From: liuxu +Date: Wed, 11 Jun 2025 16:23:09 +0800 +Subject: [PATCH] runtime: 9p use cache=none + +Signed-off-by: liuxu +--- + src/runtime/virtcontainers/kata_agent.go | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/runtime/virtcontainers/kata_agent.go b/src/runtime/virtcontainers/kata_agent.go +index a3e5f5d..0ca0997 100644 +--- a/src/runtime/virtcontainers/kata_agent.go ++++ b/src/runtime/virtcontainers/kata_agent.go +@@ -101,7 +101,14 @@ var ( + kataVfioPciDevType = "vfio-pci" // VFIO PCI device to used as VFIO in the container + kataVfioPciGuestKernelDevType = "vfio-pci-gk" // VFIO PCI device for consumption by the guest kernel + kataVfioApDevType = "vfio-ap" +- sharedDir9pOptions = []string{"trans=virtio,version=9p2000.L,cache=mmap", "nodev"} ++ /* ++ * As kata mounts 9p with cache=mmap, the 6.6 kernel 9p will use write back feature. ++ * This feature will transfer all data of the client file to the qemu backend, ++ * and the qemu 9p backend will only write the file in append mode, resulting in an extra copy of the data. ++ * Utill kernel version 6.8, this issue was fixed after merging 16df6e07d6a88dc3049a5674654ed44dfbc74d81. ++ * So use cache=none to continue using the original code path (write direct) same as 5.10. ++ */ ++ sharedDir9pOptions = []string{"trans=virtio,version=9p2000.L,cache=none", "nodev"} + sharedDirVirtioFSOptions = []string{} + sharedDirVirtioFSDaxOptions = "dax" + shmDir = "shm" +-- +2.43.0 + diff --git a/series.conf b/series.conf index b1be77e4d8ae47d890db7af82704f1bcda032d48..661113a9d3783ecc4ece5c7cb8a04024a7881e84 100644 --- a/series.conf +++ b/series.conf @@ -6,3 +6,4 @@ 0006-Allow-swappiness-to-be-1-as-default.patch 0007-Add-support-for-riscv64-platform.patch 0008-add-compilation-options-to-runtime-directory.patch +0009-kata-runtime-9p-use-cache-none.patch