From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 816E91FF15C
	for <inbox@lore.proxmox.com>; Wed, 16 Oct 2024 18:46:57 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 55E203AEF7;
	Wed, 16 Oct 2024 18:47:25 +0200 (CEST)
From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Wed, 16 Oct 2024 18:47:06 +0200
Message-Id: <20241016164711.934544-1-d.kral@proxmox.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.001 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pve-devel] [PATCH kernel/manager 0/5] fix #5430: ocfs2 io_uring
 read
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

Since around Linux kernel version 6.7 [0], and as reported by users
kernel version `6.8.4-2-pve`, a bug was introduced by a refactoring of
the io_read function in the io_uring subsystem. This causes any VM to
fail to start, when io_uring is used for CDROM drives (including
CloudInit drives) and VM disks (even though I could not reproduce the
latter).

This patch series contains the following three changes to fix this:

1. a recent (mainlined) patch that fixes the bug in io_uring (#1),
2. allow changes to aio/cache options for CDROMs in the GUI (#2-3),
3. allow changes to aio/cache options for CloudInit in the GUI (#4-5).


# pve-kernel (patch #1)

I have tested the pve-kernel patch by testing the kernel "side-by-side"
(reboot between unpatched and patched 6.8.12-2-pve kernel) with a local
minimal ocfs2 setup, which I setup in PVE as a regular directory storage
with a non-PVE-managed mountpoint:

```
apt install ocfs2-tools
mkfs.ocfs2 /dev/sde
o2cb add-cluster ocfs2test
o2cb add-node ocfs2test <hostname> --ip <local-ip>
echo "kernel.panic_on_oops = 1" > /etc/sysctl.conf
echo "kernel.panic = 30" > /etc/sysctl.conf
o2cb register-cluster ocfs2test
mkdir -p /mnt/ocfs2test
mount /dev/sde /mnt/ocfs2test
pvesm add dir ocfs2test --path /mnt/ocfs2test --is_mountpoint yes
`

The patched kernel successfully fixed the described issue with ocfs2 for
CDROM images and CloudInit drive images in any format. I also tested the
same for a few other storages using io_uring (ZFS, NFS and ext4) and
there were no regressions on my side.


# pve-manager (patch #2 - #5)

The last two UI changes are an optional part that was discussed off-list
as a solution before I knew about the kernel patch and I would still
propose it as a useful set of changes.

These changes allow users to change the cache and async I/O options for
both CDROM and CloudInit drives. These changes are not necessary for the
whole patch series and can be applied separately, or dropped.

Another discussion to this patch series - as Shannon and Fabian have
mentioned to me off-list - was if there are actual benefits for CDROM
and CloudInit drives to be read with io_uring enabled.

[0] This is the commit hash that was mentioned as the bug cause:

```
# git describe --contains a08d195b586a217d76b42062f88f375a3eedda4d
v6.7-rc1~139^2~14
```

pve-kernel:

Daniel Kral (1):
  fix #5430: cherry-pick fix for ocfs2 io_uring rw issues

 ...t-EOPNOTSUPP-for-IOCB_NOWAIT-like-EA.patch | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 patches/kernel/0021-io_uring-rw-treat-EOPNOTSUPP-for-IOCB_NOWAIT-like-EA.patch


pve-manager:

Daniel Kral (4):
  ui: vm: factor out async I/O type selector
  fix #5430: ui: vm: add aio and cache selectors to edit panel
  ui: vm: make cloudinit drive editable
  fix #5430: ui: vm: allow editing cloudinit aio and cache options

 www/manager6/Makefile                    |   1 +
 www/manager6/form/AsyncIOTypeSelector.js |  10 ++
 www/manager6/qemu/CDEdit.js              |  30 +++++-
 www/manager6/qemu/CIDriveEdit.js         | 114 ++++++++++++++++++-----
 www/manager6/qemu/HDEdit.js              |  10 +-
 www/manager6/qemu/HardwareView.js        |   4 +-
 6 files changed, 136 insertions(+), 33 deletions(-)
 create mode 100644 www/manager6/form/AsyncIOTypeSelector.js


Summary over all repositories:
  7 files changed, 181 insertions(+), 33 deletions(-)

-- 
Generated by git-murpp 0.7.2


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel