summaryrefslogtreecommitdiff
path: root/include/linux/sbitmap.h
diff options
context:
space:
mode:
authorlinke li <lilinke99@qq.com>2024-04-26 18:34:44 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-03 08:54:11 +0200
commita3e4c8f8da2c8b7e1ba537634e2df1074aa22021 (patch)
tree0624c415f56d1ea5d412fb04857957bdfdc1cb33 /include/linux/sbitmap.h
parente511167e65d332d07b3c7a3d5a741ee9c19a8c27 (diff)
sbitmap: use READ_ONCE to access map->word
[ Upstream commit 6ad0d7e0f4b68f87a98ea2b239123b7d865df86b ] In __sbitmap_queue_get_batch(), map->word is read several times, and update atomically using atomic_long_try_cmpxchg(). But the first two read of map->word is not protected. This patch moves the statement val = READ_ONCE(map->word) forward, eliminating unprotected accesses to map->word within the function. It is aimed at reducing the number of benign races reported by KCSAN in order to focus future debugging effort on harmful races. Signed-off-by: linke li <lilinke99@qq.com> Link: https://lore.kernel.org/r/tencent_0B517C25E519D3D002194E8445E86C04AD0A@qq.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Stable-dep-of: 72d04bdcf3f7 ("sbitmap: fix io hung due to race on sbitmap_word::cleared") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux/sbitmap.h')
0 files changed, 0 insertions, 0 deletions