Skip to content

Commit e4956dc

Browse files
committed
io_uring/sqpoll: annotate debug task == current with data_race()
There's a debug check in io_sq_thread_park() checking if it's the SQPOLL thread itself calling park. KCSAN warns about this, as we should not be reading sqd->thread outside of sqd->lock. Just silence this with data_race(). The pointer isn't used for anything but this debug check. Reported-by: [email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 48cc7ec commit e4956dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/sqpoll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void io_sq_thread_unpark(struct io_sq_data *sqd)
4444
void io_sq_thread_park(struct io_sq_data *sqd)
4545
__acquires(&sqd->lock)
4646
{
47-
WARN_ON_ONCE(sqd->thread == current);
47+
WARN_ON_ONCE(data_race(sqd->thread) == current);
4848

4949
atomic_inc(&sqd->park_pending);
5050
set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state);

0 commit comments

Comments
 (0)