]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] mm: hugetlb truncation fixes
authorHugh Dickins <hugh@veritas.com>
Thu, 20 Oct 2005 04:23:43 +0000 (21:23 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 20 Oct 2005 06:04:30 +0000 (23:04 -0700)
commitb423a63f550426290d414b10cdb91f778331201f
tree768e771e4da8f8f5a84d38b4b91d2fb852a4123a
parent8fe6f4688cfd09bb7e07afaa4979d74309da272a
[PATCH] mm: hugetlb truncation fixes

hugetlbfs allows truncation of its files (should it?), but hugetlb.c often
forgets that: crashes and misaccounting ensue.

copy_hugetlb_page_range better grab the src page_table_lock since we don't
want to guess what happens if concurrently truncated.  unmap_hugepage_range
rss accounting must not assume the full range was mapped.  follow_hugetlb_page
must guard with page_table_lock and be prepared to exit early.

Restyle copy_hugetlb_page_range with a for loop like the others there.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/hugetlb.c