From 8f7a81d4f0087c78b6db34d51285d8fa6a06acda Mon Sep 17 00:00:00 2001 From: PB Date: Sat, 30 Nov 2024 17:11:12 +0000 Subject: [PATCH] aufs mmap patches for k6.1 & k6.6 (#4329) * Add 6.1 & 6.6 patches 6.6 should be temporary * Update apply 6.1 & 6.6 patches 6.6 should be temporary --- kernel-kit/patches/aufs_sources/apply | 12 ++++++++++ .../patches/aufs_sources/k6.1.119.patch | 15 ++++++++++++ kernel-kit/patches/aufs_sources/k6.6.63.patch | 23 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 kernel-kit/patches/aufs_sources/k6.1.119.patch create mode 100644 kernel-kit/patches/aufs_sources/k6.6.63.patch diff --git a/kernel-kit/patches/aufs_sources/apply b/kernel-kit/patches/aufs_sources/apply index 56557a28f50..843299d45db 100755 --- a/kernel-kit/patches/aufs_sources/apply +++ b/kernel-kit/patches/aufs_sources/apply @@ -49,4 +49,16 @@ if [ "$kseries" = "5.10" ] ; then fi fi +if [ "$kseries" = "6.1" ] ; then + if vercmp $kver ge 6.1.119 ; then + patch aufs6-mmap.patch ../patches/aufs_sources/k6.1.119.patch + fi +fi + +if [ "$kseries" = "6.6" ] ; then + if vercmp $kver ge 6.6.63 ; then + patch aufs6-mmap.patch ../patches/aufs_sources/k6.6.63.patch + fi +fi + ### END ### diff --git a/kernel-kit/patches/aufs_sources/k6.1.119.patch b/kernel-kit/patches/aufs_sources/k6.1.119.patch new file mode 100644 index 00000000000..4c5408a80ca --- /dev/null +++ b/kernel-kit/patches/aufs_sources/k6.1.119.patch @@ -0,0 +1,15 @@ +--- aufs6-mmap.patch.orig 2024-11-30 11:59:55.826601709 +0000 ++++ aufs6-mmap.patch 2024-11-30 11:57:13.876603849 +0000 +@@ -237,9 +237,9 @@ + vma = merge; + /* Update vm_flags to pick up the change. */ + @@ -2746,7 +2746,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, +- if (vma->vm_ops && vma->vm_ops->close) +- vma->vm_ops->close(vma); +- unmap_and_free_vma: ++ return addr; ++ ++ unmap_and_free_file_vma: + - fput(vma->vm_file); + + vma_fput(vma); + vma->vm_file = NULL; diff --git a/kernel-kit/patches/aufs_sources/k6.6.63.patch b/kernel-kit/patches/aufs_sources/k6.6.63.patch new file mode 100644 index 00000000000..ddc0457cfda --- /dev/null +++ b/kernel-kit/patches/aufs_sources/k6.6.63.patch @@ -0,0 +1,23 @@ +--- aufs6-mmap.patch.orig 2024-11-30 12:04:39.029931230 +0000 ++++ aufs6-mmap.patch 2024-11-30 11:42:03.209949373 +0000 +@@ -219,14 +219,14 @@ + vma = merge; + /* Update vm_flags to pick up the change. */ + @@ -2904,7 +2904,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, ++ return addr; + +- if (file || vma->vm_file) { +- unmap_and_free_vma: +-- fput(vma->vm_file); +-+ vma_fput(vma); +- vma->vm_file = NULL; ++ unmap_and_free_file_vma: ++- fput(vma->vm_file); +++ vma_fput(vma); ++ vma->vm_file = NULL; + +- vma_iter_set(&vmi, vma->vm_end); ++ vma_iter_set(&vmi, vma->vm_end); + @@ -2966,6 +2966,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, + unsigned long populate = 0; + unsigned long ret = -EINVAL;