summaryrefslogtreecommitdiff
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorZi Yan <ziy@nvidia.com>2025-07-17 22:29:58 -0400
committerAndrew Morton <akpm@linux-foundation.org>2025-07-24 19:12:39 -0700
commit714b056c8321066f5a20d3045a95398092f7c1b9 (patch)
tree54444515202e9f3e8c8f93fa6bdb37ee1b863018 /mm/huge_memory.c
parent391dc7f40590d793f0e5214b6e9324b1af8fa40d (diff)
downloadlinux-next-714b056c8321066f5a20d3045a95398092f7c1b9.tar.gz
linux-next-714b056c8321066f5a20d3045a95398092f7c1b9.zip
mm/huge_memory: convert VM_BUG* to VM_WARN* in __folio_split
These VM_BUG* can be handled gracefully without crashing kernel. Link: https://lkml.kernel.org/r/20250718023000.4044406-5-ziy@nvidia.com Link: https://lkml.kernel.org/r/20250718183720.4054515-5-ziy@nvidia.com Signed-off-by: Zi Yan <ziy@nvidia.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Acked-by: David Hildenbrand <david@redhat.com> Cc: Antonio Quartulli <antonio@mandelbit.com> Cc: Balbir Singh <balbirs@nvidia.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Barry Song <baohua@kernel.org> Cc: Dan Carpenter <dan.carpenter@linaro.org> Cc: Dev Jain <dev.jain@arm.com> Cc: Hugh Dickins <hughd@google.com> Cc: Kirill A. Shutemov <k.shutemov@gmail.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Mariano Pache <npache@redhat.com> Cc: Mathew Brost <matthew.brost@intel.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index d36f7bdaeb38..d98283164eda 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3601,8 +3601,8 @@ static int __folio_split(struct folio *folio, unsigned int new_order,
pgoff_t end;
bool is_hzp;
- VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
- VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
+ VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio);
+ VM_WARN_ON_ONCE_FOLIO(!folio_test_large(folio), folio);
if (folio != page_folio(split_at) || folio != page_folio(lock_at))
return -EINVAL;
@@ -3766,7 +3766,11 @@ static int __folio_split(struct folio *folio, unsigned int new_order,
}
if (folio_test_swapcache(folio)) {
- VM_BUG_ON(mapping);
+ if (mapping) {
+ VM_WARN_ON_ONCE_FOLIO(mapping, folio);
+ ret = -EINVAL;
+ goto fail;
+ }
swap_cache = swap_address_space(folio->swap);
xa_lock(&swap_cache->i_pages);