From: Greg Kroah-Hartman Date: Tue, 4 Jul 2023 08:42:02 +0000 (+0100) Subject: drop queue-6.3/hugetlb-revert-use-of-page_cache_next_miss.patch X-Git-Tag: v5.15.120~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a87fbdc258ffdaddfd4992671e5b9940c9d71eae;p=thirdparty%2Fkernel%2Fstable-queue.git drop queue-6.3/hugetlb-revert-use-of-page_cache_next_miss.patch Not yet for 6.3, causes LTP regressions --- diff --git a/queue-6.3/hugetlb-revert-use-of-page_cache_next_miss.patch b/queue-6.3/hugetlb-revert-use-of-page_cache_next_miss.patch deleted file mode 100644 index fa6c539ea44..00000000000 --- a/queue-6.3/hugetlb-revert-use-of-page_cache_next_miss.patch +++ /dev/null @@ -1,96 +0,0 @@ -From fd4aed8d985a3236d0877ff6d0c80ad39d4ce81a Mon Sep 17 00:00:00 2001 -From: Mike Kravetz -Date: Wed, 21 Jun 2023 14:24:03 -0700 -Subject: hugetlb: revert use of page_cache_next_miss() - -From: Mike Kravetz - -commit fd4aed8d985a3236d0877ff6d0c80ad39d4ce81a upstream. - -Ackerley Tng reported an issue with hugetlbfs fallocate as noted in the -Closes tag. The issue showed up after the conversion of hugetlb page -cache lookup code to use page_cache_next_miss. User visible effects are: - -- hugetlbfs fallocate incorrectly returns -EEXIST if pages are presnet - in the file. -- hugetlb pages will not be included in core dumps if they need to be - brought in via GUP. -- userfaultfd UFFDIO_COPY will not notice pages already present in the - cache. It may try to allocate a new page and potentially return - ENOMEM as opposed to EEXIST. - -Revert the use page_cache_next_miss() in hugetlb code. - -IMPORTANT NOTE FOR STABLE BACKPORTS: -This patch will apply cleanly to v6.3. However, due to the change of -filemap_get_folio() return values, it will not function correctly. This -patch must be modified for stable backports. - -[dan.carpenter@linaro.org: fix hugetlbfs_pagecache_present()] - Link: https://lkml.kernel.org/r/efa86091-6a2c-4064-8f55-9b44e1313015@moroto.mountain -Link: https://lkml.kernel.org/r/20230621212403.174710-2-mike.kravetz@oracle.com -Fixes: d0ce0e47b323 ("mm/hugetlb: convert hugetlb fault paths to use alloc_hugetlb_folio()") -Signed-off-by: Mike Kravetz -Signed-off-by: Dan Carpenter -Reported-by: Ackerley Tng -Closes: https://lore.kernel.org/linux-mm/cover.1683069252.git.ackerleytng@google.com -Reviewed-by: Sidhartha Kumar -Cc: Erdem Aktas -Cc: Greg Kroah-Hartman -Cc: Matthew Wilcox -Cc: Muchun Song -Cc: Vishal Annapurve -Signed-off-by: Andrew Morton -Signed-off-by: Sidhartha Kumar -Signed-off-by: Greg Kroah-Hartman ---- - fs/hugetlbfs/inode.c | 8 +++----- - mm/hugetlb.c | 12 ++++++------ - 2 files changed, 9 insertions(+), 11 deletions(-) - ---- a/fs/hugetlbfs/inode.c -+++ b/fs/hugetlbfs/inode.c -@@ -821,7 +821,6 @@ static long hugetlbfs_fallocate(struct f - */ - struct folio *folio; - unsigned long addr; -- bool present; - - cond_resched(); - -@@ -845,10 +844,9 @@ static long hugetlbfs_fallocate(struct f - mutex_lock(&hugetlb_fault_mutex_table[hash]); - - /* See if already present in mapping to avoid alloc/free */ -- rcu_read_lock(); -- present = page_cache_next_miss(mapping, index, 1) != index; -- rcu_read_unlock(); -- if (present) { -+ folio = filemap_get_folio(mapping, index); -+ if (!IS_ERR(folio)) { -+ folio_put(folio); - mutex_unlock(&hugetlb_fault_mutex_table[hash]); - hugetlb_drop_vma_policy(&pseudo_vma); - continue; ---- a/mm/hugetlb.c -+++ b/mm/hugetlb.c -@@ -5672,13 +5672,13 @@ static bool hugetlbfs_pagecache_present( - { - struct address_space *mapping = vma->vm_file->f_mapping; - pgoff_t idx = vma_hugecache_offset(h, vma, address); -- bool present; -+ struct folio *folio; - -- rcu_read_lock(); -- present = page_cache_next_miss(mapping, idx, 1) != idx; -- rcu_read_unlock(); -- -- return present; -+ folio = filemap_get_folio(mapping, idx); -+ if (IS_ERR(folio)) -+ return false; -+ folio_put(folio); -+ return true; - } - - int hugetlb_add_to_page_cache(struct folio *folio, struct address_space *mapping, diff --git a/queue-6.3/series b/queue-6.3/series index 28aa1ba573e..4b5e6710362 100644 --- a/queue-6.3/series +++ b/queue-6.3/series @@ -6,7 +6,6 @@ execve-always-mark-stack-as-growing-down-during-early-stack-setup.patch nfs-don-t-report-statx_btime-in-getattr.patch revert-cxl-port-enable-the-hdm-decoder-capability-for-switch-ports.patch nubus-partially-revert-proc_create_single_data-conversion.patch -hugetlb-revert-use-of-page_cache_next_miss.patch scripts-tags.sh-resolve-gtags-empty-index-generation.patch docs-set-minimal-gtags-gnu-global-version-to-6.6.5.patch dm-ioctl-avoid-double-fetch-of-version.patch