summaryrefslogtreecommitdiff
path: root/net/unix/scm.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/unix/scm.c')
-rw-r--r--net/unix/scm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/unix/scm.c b/net/unix/scm.c
index 8c40f2b32392..ce700b22ecce 100644
--- a/net/unix/scm.c
+++ b/net/unix/scm.c
@@ -59,7 +59,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);
@@ -79,7 +80,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);