diff options
| author | 2023-07-31 09:39:56 +0200 | |
|---|---|---|
| committer | 2023-07-31 09:39:56 +0200 | |
| commit | fe3015748a905e08eb0e1750aa2928f520063d59 (patch) | |
| tree | d15524d1f7931e8e5964e9ff8368792d09282da5 /include/linux/mmap_lock.h | |
| parent | parport_pc: add support for ASIX AX99100 (diff) | |
| parent | Linux 6.5-rc4 (diff) | |
| download | wireguard-linux-fe3015748a905e08eb0e1750aa2928f520063d59.tar.xz wireguard-linux-fe3015748a905e08eb0e1750aa2928f520063d59.zip | |
Merge 6.5-rc4 into tty-next
We need the serial/tty fixes in here as well for testing and future
development.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/mmap_lock.h')
| -rw-r--r-- | include/linux/mmap_lock.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h index aab8f1b28d26..e05e167dbd16 100644 --- a/include/linux/mmap_lock.h +++ b/include/linux/mmap_lock.h @@ -76,8 +76,14 @@ static inline void mmap_assert_write_locked(struct mm_struct *mm) static inline void vma_end_write_all(struct mm_struct *mm) { mmap_assert_write_locked(mm); - /* No races during update due to exclusive mmap_lock being held */ - WRITE_ONCE(mm->mm_lock_seq, mm->mm_lock_seq + 1); + /* + * Nobody can concurrently modify mm->mm_lock_seq due to exclusive + * mmap_lock being held. + * We need RELEASE semantics here to ensure that preceding stores into + * the VMA take effect before we unlock it with this store. + * Pairs with ACQUIRE semantics in vma_start_read(). + */ + smp_store_release(&mm->mm_lock_seq, mm->mm_lock_seq + 1); } #else static inline void vma_end_write_all(struct mm_struct *mm) {} |
