]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #4099: disable io_uring for virtual disks on CIFS storages
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 27 Oct 2022 07:13:45 +0000 (09:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 28 Oct 2022 08:15:19 +0000 (10:15 +0200)
Since kernel 5.15, there is an issue with io_uring when used in
combination with CIFS [0]. Unfortunately, the kernel developers did
not suggest any way to resolve the issue and didn't comment on my
proposed one. So for now, just disable io_uring when the storage is
CIFS, like is done for other storage types that had problematic
interactions.

It is rather easy to reproduce when writing large amounts of data
within the VM. I used
dd if=/dev/urandom of=file bs=1M count=1000
to reproduce it consistently, but your mileage may vary.

Some forum reports about users running into the issue [1][2][3].

[0]: https://www.spinics.net/lists/linux-cifs/msg26734.html
[1]: https://forum.proxmox.com/threads/109848/
[2]: https://forum.proxmox.com/threads/110464/
[3]: https://forum.proxmox.com/threads/111382/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/QemuServer.pm

index 4e85dd02c43dba598b6f92a01a75d1d4a9f301e0..513a248f11616be919aff47b346f34c382e1001e 100644 (file)
@@ -1665,8 +1665,12 @@ sub print_drive_commandline_full {
     # sometimes, just plain disable...
     my $lvm_no_io_uring = $scfg && $scfg->{type} eq 'lvm';
 
+    # io_uring causes problems when used with CIFS since kernel 5.15
+    # Some discussion: https://www.spinics.net/lists/linux-cifs/msg26734.html
+    my $cifs_no_io_uring = $scfg && $scfg->{type} eq 'cifs';
+
     if (!$drive->{aio}) {
-       if ($io_uring && !$rbd_no_io_uring && !$lvm_no_io_uring) {
+       if ($io_uring && !$rbd_no_io_uring && !$lvm_no_io_uring && !$cifs_no_io_uring) {
            # io_uring supports all cache modes
            $opts .= ",aio=io_uring";
        } else {