diff options
| author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-04-01 16:12:31 +0100 |
|---|---|---|
| committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-04-01 16:12:31 +0100 |
| commit | de4fb176622d54a82ea3ceb7362392aaf5ff0b5a (patch) | |
| tree | 8b510763d14d89b97cd719e79834c84e095932d7 /net/unix/scm.c | |
| parent | 9be4c88bb7924f68f88cfd47d925c2d046f51a73 (diff) | |
| parent | 9c6d6652e950fb34295f446676a811f6df5b8561 (diff) | |
Merge branches 'fixes' and 'misc' into for-linus
Diffstat (limited to 'net/unix/scm.c')
| -rw-r--r-- | net/unix/scm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/unix/scm.c b/net/unix/scm.c index 052ae709ce28..aa27a02478dc 100644 --- a/net/unix/scm.c +++ b/net/unix/scm.c @@ -60,7 +60,8 @@ void unix_inflight(struct user_struct *user, struct file *fp) } else { BUG_ON(list_empty(&u->link)); } - unix_tot_inflight++; + /* Paired with READ_ONCE() in wait_for_unix_gc() */ + WRITE_ONCE(unix_tot_inflight, unix_tot_inflight + 1); } user->unix_inflight++; spin_unlock(&unix_gc_lock); @@ -80,7 +81,8 @@ void unix_notinflight(struct user_struct *user, struct file *fp) if (atomic_long_dec_and_test(&u->inflight)) list_del_init(&u->link); - unix_tot_inflight--; + /* Paired with READ_ONCE() in wait_for_unix_gc() */ + WRITE_ONCE(unix_tot_inflight, unix_tot_inflight - 1); } user->unix_inflight--; spin_unlock(&unix_gc_lock); |
