diff options
| author | Jeferson Oliveira <jroliveira.oliveira301@gmail.com> | 2022-02-21 13:08:24 +0100 |
|---|---|---|
| committer | Jeferson Oliveira <jroliveira.oliveira301@gmail.com> | 2022-02-21 13:08:36 +0100 |
| commit | 9b192fc7d0d03c5485644ed0311d5037fee0fa15 (patch) | |
| tree | d1651900969ca7b9787b7f5434f248df1c29fbd4 /net/unix/scm.c | |
| parent | 1904adc0bb37e30c472eccb7bbe5e724d7cc2595 (diff) | |
| parent | a09b2d8f61ea0e9ae735c400399b97966a9418d6 (diff) | |
Merge tag 'v4.4.302' of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux into r11.1r11.1
This is the 4.4.302 stable release
Change-Id: Ic0294f56b50ff2e461e0bee426dd28c25f1e741e
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 df8f636ab1d8..bf1a8fa8c4f1 100644 --- a/net/unix/scm.c +++ b/net/unix/scm.c @@ -56,7 +56,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); @@ -76,7 +77,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); |
