[PATCH -mm] mm: hugetlbfs: Correctly populate shared pmd

From: Michal Hocko
Date: Thu Aug 02 2012 - 10:16:53 EST


Hi Andrew,
the following patch fixes yet-another race in the hugetlb pte sharing
code reported by Larry. It is based on top of the current -mm tree but
it cleanly applies to linus tree as well. It should go to stable as
well. The bug is there for ages but this fix is possible only since 3.0
because i_mmap_lock used to be a spinlock until 3d48ae45 which turned it
into mutex and so we can call pmd_alloc.
There was another candidate for the same issue by Mel
(https://lkml.org/lkml/2012/7/31/275) but we considered this one to be
better because it is more focused on the arch specific code and it also
highers chances for sharing.
---