mm: Remove BUG_ON mmap_sem not held from xxx_trans_huge_lock()
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 1 Oct 2019 08:37:33 +0000 (10:37 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 6 Nov 2019 12:02:17 +0000 (13:02 +0100)
commitea81bae46032022656d45d4a395f1bf3b96697f0
tree500d2722b72ca83e669ab8bf0725eb892ae82947
parent7aef29f4d4613570f413301b0807ea66a21f5e3b
mm: Remove BUG_ON mmap_sem not held from xxx_trans_huge_lock()

The caller needs to make sure that the vma is not torn down during the
lock operation and can also use the i_mmap_rwsem for file-backed vmas.
Remove the BUG_ON. We could, as an alternative, add a test that either
vma->vm_mm->mmap_sem or vma->vm_file->f_mapping->i_mmap_rwsem are held.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
include/linux/huge_mm.h