mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hugetlbfs: fix stale comment in hugetlbfs_file_mmap()
@ 2026-09-23  2:28 Zhenghui Hao
  2026-09-23  2:42 ` Muchun Song
  0 siblings, 1 reply; 2+ messages in thread
From: Zhenghui Hao @ 2026-09-23  2:28 UTC (permalink / raw)
  To: linux-mm
  Cc: Muchun Song, Oscar Salvador, David Hildenbrand, Andrew Morton,
	linux-kernel, Zhenghui Hao

The comment above the VMA flag setup in hugetlbfs_file_mmap() says the VMA
address alignment has already been checked by prepare_hugepage_range().
That function no longer exists: it was removed by commit eff41389d824
("mm/hugetlb: remove prepare_hugepage_range()"), and the check now lives in
hugetlb_get_unmapped_area().

The comment also mentions ia64, which was removed from the tree by commit
cf8e8658100d ("arch: Remove Itanium (IA-64) architecture").

Point the comment at the current function and drop the ia64 reference.  The
rest of the comment, which tells future edits to add any error return only
after VM_HUGETLB has been set, is still accurate and is left untouched.

No functional change.

Signed-off-by: Zhenghui Hao <zhenghui.hao@qq.com>
---
 fs/hugetlbfs/inode.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 7611a8470ea2..e2aaf1b56e7f 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -106,11 +106,10 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
 
 	/*
 	 * vma address alignment (but not the pgoff alignment) has
-	 * already been checked by prepare_hugepage_range.  If you add
-	 * any error returns here, do so after setting VM_HUGETLB, so
-	 * is_vm_hugetlb_page tests below unmap_region go the right
-	 * way when do_mmap unwinds (may be important on powerpc
-	 * and ia64).
+	 * already been checked by hugetlb_get_unmapped_area().  If you
+	 * add any error returns here, do so after setting VM_HUGETLB,
+	 * so is_vm_hugetlb_page tests below unmap_region go the right
+	 * way when do_mmap unwinds (may be important on powerpc).
 	 */
 	vma_set_flags(vma, VMA_HUGETLB_BIT, VMA_DONTEXPAND_BIT);
 	vma->vm_ops = &hugetlb_vm_ops;

base-commit: 93f51579e7df248780214094418f205253383cc5
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-23  2:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23  2:28 [PATCH] hugetlbfs: fix stale comment in hugetlbfs_file_mmap() Zhenghui Hao
2026-09-23  2:42 ` Muchun Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®