path: root/fs/hugetlbfs
diff options
authorMuchun Song <>2021-02-04 18:32:03 -0800
committerLinus Torvalds <>2021-02-05 11:03:47 -0800
commit585fc0d2871c9318c949fbf45b1f081edd489e96 (patch)
tree1beba3b505141b93d96576c5e131018b93813b55 /fs/hugetlbfs
parent5c279c4cf206e03995e04fd3404fa95ffd243a97 (diff)
mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page
If a new hugetlb page is allocated during fallocate it will not be marked as active (set_page_huge_active) which will result in a later isolate_huge_page failure when the page migration code would like to move that page. Such a failure would be unexpected and wrong. Only export set_page_huge_active, just leave clear_page_huge_active as static. Because there are no external users. Link: Fixes: 70c3547e36f5 (hugetlbfs: add hugetlbfs_fallocate()) Signed-off-by: Muchun Song <> Acked-by: Michal Hocko <> Reviewed-by: Mike Kravetz <> Reviewed-by: Oscar Salvador <> Cc: David Hildenbrand <> Cc: Yang Shi <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'fs/hugetlbfs')
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index b5c109703daa..21c20fd5f9ee 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -735,9 +735,10 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,
+ set_page_huge_active(page);
* unlock_page because locked by add_to_page_cache()
- * page_put due to reference from alloc_huge_page()
+ * put_page() due to reference from alloc_huge_page()