The patch titled Subject: mm/mmap.c: use mmap_assert_write_locked() instead of open coding it has been added to the -mm tree. Its filename is mm-use-mmap_assert_write_locked-instead-of-open-coding-it.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-use-mmap_assert_write_locked-instead-of-open-coding-it.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-use-mmap_assert_write_locked-instead-of-open-coding-it.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Rolf Eike Beer <eb@xxxxxxxxx> Subject: mm/mmap.c: use mmap_assert_write_locked() instead of open coding it In case the lock is actually not held at this point. Link: https://lkml.kernel.org/r/5827758.TJ1SttVevJ@xxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Rolf Eike Beer <eb@xxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/mmap.c~mm-use-mmap_assert_write_locked-instead-of-open-coding-it +++ a/mm/mmap.c @@ -3561,7 +3561,7 @@ int mm_take_all_locks(struct mm_struct * struct vm_area_struct *vma; struct anon_vma_chain *avc; - BUG_ON(mmap_read_trylock(mm)); + mmap_assert_write_locked(mm); mutex_lock(&mm_all_locks_mutex); @@ -3641,7 +3641,7 @@ void mm_drop_all_locks(struct mm_struct struct vm_area_struct *vma; struct anon_vma_chain *avc; - BUG_ON(mmap_read_trylock(mm)); + mmap_assert_write_locked(mm); BUG_ON(!mutex_is_locked(&mm_all_locks_mutex)); for (vma = mm->mmap; vma; vma = vma->vm_next) { _ Patches currently in -mm which might be from eb@xxxxxxxxx are mm-use-mmap_assert_write_locked-instead-of-open-coding-it.patch