diff options
author | Rolf Eike Beer <eb@emlix.com> | 2022-04-28 23:16:11 -0700 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-04-28 23:16:11 -0700 |
commit | 325bca1fe0b1bb9f535e69bb9ec48d4a6e0ca3ce (patch) | |
tree | a5998e128bc2e4b6f728bacd060edf4b7c08a608 /mm/mmap.c | |
parent | 241ec63a9a0fbb39292ea1dd2d07f8dabedfe3df (diff) | |
download | linux-325bca1fe0b1bb9f535e69bb9ec48d4a6e0ca3ce.tar.gz linux-325bca1fe0b1bb9f535e69bb9ec48d4a6e0ca3ce.tar.bz2 linux-325bca1fe0b1bb9f535e69bb9ec48d4a6e0ca3ce.zip |
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@mobilepool36.emlix.com
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index 313b57d55a63..042f01ec02fe 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3553,7 +3553,7 @@ int mm_take_all_locks(struct mm_struct *mm) 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); @@ -3633,7 +3633,7 @@ void mm_drop_all_locks(struct mm_struct *mm) 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) { |