From 803ddb6d55e6811adff698334c36ea5d207077c3 Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Wed, 3 Apr 2024 13:46:03 +0200 Subject: [PATCH] revert cifs backport to 6.1 added between 6.5.13-1 and 6.5.13-2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit copying files within a cifs-share currently result in the following trace: ``` [ 495.388739] BUG: unable to handle page fault for address: fffffffffffffffe [ 495.388744] #PF: supervisor read access in kernel mode [ 495.388746] #PF: error_code(0x0000) - not-present page [ 495.388747] PGD 172c3f067 P4D 172c3f067 PUD 172c41067 PMD 0 [ 495.388752] Oops: 0000 [#2] PREEMPT SMP NOPTI [ 495.388754] CPU: 1 PID: 3894 Comm: cp Tainted: G D 6.5.0-32-generic #32-Ubuntu [ 495.388756] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 4.2023.08-4 02/15/2024 [ 495.388758] RIP: 0010:cifs_flush_folio+0x41/0xf0 [cifs] ... ``` a quick check identified proxmox-kernel-6.5.13-2 as the first affected version, and `2dc07a11e269bfbe5589e99b60cdbae0118be979` as likely source of the issue. The commit adapts the changes from `7b2404a886f8b91250c31855d287e632123e1746` to work with the code in kernel 6.1. This is not needed as the relevant changes were made in 6.4 and are already part of the 6.5 tree - `66dabbb65d673aef40dd17bf62c042be8f6d4a4b` reverting the commit fixes copying files within a samba share. Tested/reproduced with: * a VM with the kernel as cifs-client * one very crude samba-share allowing guest-write access on a Debian bookworm host * as well as a share using cifscreds + multiuser (`mount.cifs(8)`) * mounting the share, copying any file from one directory to another on the same share (with `cp` and Thunar and Nautilus). Reported to Ubuntu upstream at [1]. [0] https://lore.kernel.org/linux-mm/ZZhrpNJ3zxMR8wcU@eldamar.lan/ [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2055002 Reported-by: Daniela Häsler Signed-off-by: Stoiko Ivanov --- ...flushing-folio-regression-for-6.1-ba.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patches/kernel/0014-Revert-cifs-fix-flushing-folio-regression-for-6.1-ba.patch diff --git a/patches/kernel/0014-Revert-cifs-fix-flushing-folio-regression-for-6.1-ba.patch b/patches/kernel/0014-Revert-cifs-fix-flushing-folio-regression-for-6.1-ba.patch new file mode 100644 index 0000000..e033b68 --- /dev/null +++ b/patches/kernel/0014-Revert-cifs-fix-flushing-folio-regression-for-6.1-ba.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Stoiko Ivanov +Date: Wed, 3 Apr 2024 10:29:59 +0200 +Subject: [PATCH] Revert "cifs: fix flushing folio regression for 6.1 backport" + +This reverts commit 2dc07a11e269bfbe5589e99b60cdbae0118be979. +--- + fs/smb/client/cifsfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c +index 55a6d0296ec82..82313b2534631 100644 +--- a/fs/smb/client/cifsfs.c ++++ b/fs/smb/client/cifsfs.c +@@ -1245,7 +1245,7 @@ static int cifs_flush_folio(struct inode *inode, loff_t pos, loff_t *_fstart, lo + int rc = 0; + + folio = filemap_get_folio(inode->i_mapping, index); +- if (!folio) ++ if (IS_ERR(folio)) + return 0; + + size = folio_size(folio);