Linus Torvalds b5641a5d8b mm: don't do validate_mm() unnecessarily and without mmap locking
This is an addition to commit ae80b4041984 ("mm: validate the mm before
dropping the mmap lock"), because it turns out there were two problems,
but lockdep just stopped complaining after finding the first one.

The do_vmi_align_munmap() function now drops the mmap lock after doing
the validate_mm() call, but it turns out that one of the callers then
immediately calls validate_mm() again.

That's both a bit silly, and now (again) happens without the mmap lock
held.

So just remove that validate_mm() call from the caller, but make sure to
not lose any coverage by doing that mm sanity checking in the error path
of do_vmi_align_munmap() too.

Reported-and-tested-by: kernel test robot <oliver.sang@intel.com>
Link: https://lore.kernel.org/lkml/ZKN6CdkKyxBShPHi@xsang-OptiPlex-9020/
Fixes: 408579cd627a ("mm: Update do_vmi_align_munmap() return semantics")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-07-04 07:22:59 -07:00
..
2023-06-09 16:25:17 -07:00
2023-06-19 16:19:05 -07:00
2023-06-28 20:35:21 -07:00
2023-06-19 16:19:25 -07:00
2023-06-19 16:19:25 -07:00
2023-06-23 16:59:30 -07:00
2023-06-19 16:19:25 -07:00
2023-04-30 13:00:38 -07:00
2023-06-29 16:34:12 -07:00
2023-06-23 16:59:30 -07:00
2023-04-12 17:36:23 -07:00
2023-06-19 16:19:25 -07:00
2023-06-29 23:21:20 -07:00
2023-06-19 16:19:25 -07:00
2023-06-19 16:19:25 -07:00
2023-06-19 16:19:25 -07:00
2023-06-19 16:19:25 -07:00
2022-10-03 14:02:43 -07:00
2022-09-26 19:46:09 -07:00
2023-06-19 16:19:25 -07:00
2021-05-07 00:26:35 -07:00
2023-06-19 16:19:25 -07:00
2023-06-19 16:19:25 -07:00
2023-06-29 16:34:12 -07:00
2023-06-29 16:34:12 -07:00
2023-06-29 16:34:12 -07:00
2023-06-29 16:34:12 -07:00
2023-06-19 16:19:25 -07:00
2023-06-23 16:59:30 -07:00
2023-06-23 16:59:30 -07:00
2023-04-12 17:36:23 -07:00
2023-06-19 16:19:25 -07:00
2023-04-08 13:45:37 -07:00