diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2022-06-08 17:40:30 +0300 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-07-04 04:08:42 +0300 |
commit | c8945306976f497802b208cf8f2cad4543868bc6 (patch) | |
tree | 52be9312a6af5bfc3e1688252c5247060ac89abe /fs/cifs/smb2glob.h | |
parent | 5e21f2d577cf174ced5fe9bdff67dcb70190d9f8 (diff) | |
download | linux-c8945306976f497802b208cf8f2cad4543868bc6.tar.xz |
mm/swapfile: fix possible data races of inuse_pages
si->inuse_pages could still be accessed concurrently now. The plain reads
outside si->lock critical section, i.e. swap_show and si_swapinfo, which
results in data races. READ_ONCE and WRITE_ONCE is used to fix such data
races. Note these data races should be ok because they're just used for
showing swap info.
[linmiaohe@huawei.com: use WRITE_ONCE to pair with READ_ONCE]
Link: https://lkml.kernel.org/r/20220625093346.48894-2-linmiaohe@huawei.com
Link: https://lkml.kernel.org/r/20220608144031.829-3-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/cifs/smb2glob.h')
0 files changed, 0 insertions, 0 deletions