Commit 32065dc4 authored by Hugh Dickins's avatar Hugh Dickins Committed by Chris Wright
Browse files

[PATCH] hugetlbfs mmap ENOMEM failure



2.6.15's hugepage faulting introduced huge_pages_needed accounting into
hugetlbfs: to count how many pages are already in cache, for spot check
on how far a new mapping may be allowed to extend the file.  But it's
muddled: each hugepage found covers HPAGE_SIZE, not PAGE_SIZE.  Once
pages were already in cache, it would overshoot, wrap its hugepages
count backwards, and so fail a harmless repeat mapping with -ENOMEM.
Fixes the problem found by Don Dupuis.

Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Acked-By: default avatarAdam Litke <agl@us.ibm.com>
Acked-by: default avatarWilliam Irwin <wli@us.ibm.com>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bcf2887b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment