diff options
| author | Kuniyuki Iwashima <[email protected]> | 2024-01-23 17:08:52 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-01-27 04:34:24 +0000 |
| commit | 31e03207119a535d0b0e3b3a7f91983aeb2cb14d (patch) | |
| tree | 3b57a2704b30a19f5f7cfb675eae68fdf2315afc /net/unix/garbage.c | |
| parent | net: dsa: mt7530: select MEDIATEK_GE_PHY for NET_DSA_MT7530_MDIO (diff) | |
| download | kernel-31e03207119a535d0b0e3b3a7f91983aeb2cb14d.tar.gz kernel-31e03207119a535d0b0e3b3a7f91983aeb2cb14d.zip | |
af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc().
gc_in_progress is changed under spin_lock(&unix_gc_lock),
but wait_for_unix_gc() reads it locklessly.
Let's use READ_ONCE().
Fixes: 5f23b734963e ("net: Fix soft lockups/OOM issues w/ unix garbage collector")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/unix/garbage.c')
| -rw-r--r-- | net/unix/garbage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 2405f0f9af31..af3d2221cf6a 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c @@ -198,7 +198,7 @@ void wait_for_unix_gc(void) if (READ_ONCE(unix_tot_inflight) > UNIX_INFLIGHT_TRIGGER_GC && !READ_ONCE(gc_in_progress)) unix_gc(); - wait_event(unix_gc_wait, gc_in_progress == false); + wait_event(unix_gc_wait, !READ_ONCE(gc_in_progress)); } /* The external entry point: unix_gc() */ |
