diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 8e1b7825e2f3fd61dddc50d5c54a7d694708c387..fe625cd1719aca15eb45c09c2beef62b5dc91368 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -112,6 +113,12 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, if (len > TASK_SIZE) return -ENOMEM; + if (flags & MAP_FIXED) { + if (prepare_hugepage_range(addr, len, pgoff)) + return -EINVAL; + return addr; + } + if (addr) { addr = ALIGN(addr, HPAGE_SIZE); vma = find_vma(mm, addr);