powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds the allowed...
authorjmarchan@redhat.com <jmarchan@redhat.com>
Wed, 15 Jan 2014 15:27:11 +0000 (16:27 +0100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 29 Jan 2014 06:02:25 +0000 (17:02 +1100)
commit19751c07b3728748c1253627ce94e6906fa5e273
tree5352397bce49d1c23e8df8fdd58db587a9edbae0
parent2c2e6ecfd077cbae72d32568af58c4ba57826c84
powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds the allowed address space

According to Posix, if MAP_FIXED is specified mmap shall set ENOMEM if
the requested mapping exceeds the allowed range for address space of
the process. The generic code set it right, but the specific powerpc
slice_get_unmapped_area() function currently returns -EINVAL in that
case.
This patch corrects it.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/slice.c