]> git.baikalelectronics.ru Git - kernel.git/commit
mm: revert mremap pud_free anti-fix
authorHugh Dickins <hughd@google.com>
Wed, 16 Oct 2013 20:47:09 +0000 (13:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Oct 2013 04:35:53 +0000 (21:35 -0700)
commit7ef5613372a2e627c3a428a890d76ddf807e6eff
treefe920bc16fe4ef97e94d31fce5f25bbecaff6e57
parent19936fd79fd28bc2f74b7f25ee52261a78813300
mm: revert mremap pud_free anti-fix

Revert commit f0c0c2340f0b ("mm/mremap.c: call pud_free() after fail
calling pmd_alloc()").

The original code was correct: pud_alloc(), pmd_alloc(), pte_alloc_map()
ensure that the pud, pmd, pt is already allocated, and seldom do they
need to allocate; on failure, upper levels are freed if appropriate by
the subsequent do_munmap().  Whereas commit f0c0c2340f0b did an
unconditional pud_free() of a most-likely still-in-use pud: saved only
by the near-impossiblity of pmd_alloc() failing.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mremap.c