lkml.org 
[lkml]   [2005]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] general split_vma hugetlb fix
On Fri, Feb 11, 2005 at 08:06:08PM +0000, Hugh Dickins wrote:
> My recent do_munmap hugetlb fix has proved inadequate. There are
> other places (madvise, mbind, mlock, mprotect) where split_vma is
> called. Only mprotect excludes a hugetlb vma: the others are in
> danger of splitting at a misaligned address, causing later BUGs.
> So move the ~HPAGE_MASK check from do_munmap to split_vma itself;
> and fix up those places (madvise and mlock) which expect split_vma
> can fail only with -ENOMEM, and wish to convert that to -EAGAIN.
> (It appears genuine that some of these syscalls should be failing
> with -ENOMEM and some with -EAGAIN, so respect those behaviours.)
> madvise_dontneed doesn't use split_vma, but is equally in danger
> of causing a hugetlb BUG via zap_page_range. Whereas elsewhere the
> patch is permissive (allowing the operation on a hugetlb vma even when
> pointless, so long as it doesn't missplit it), here we must use -EINVAL
> on any hugetlb vma, since a page fault would hit the BUG in its nopage.
> Signed-off-by: Hugh Dickins <hugh@veritas.com>

As usual, excellent work, Hugh. akpm, Linus, please apply.

Acked-by: William Irwin <wli@holomorphy.com>


-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.202 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site