summaryrefslogtreecommitdiffstats
path: root/net/unix/scm.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 02:25:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 02:25:20 +0000
commit8372e24aca862ae1fdd54a442fba92dc9b4b6161 (patch)
tree5fb60c5cd3d6bb6496650d1605a3c51d09be2bf1 /net/unix/scm.c
parentAdding debian version 6.1.85-1. (diff)
downloadlinux-8372e24aca862ae1fdd54a442fba92dc9b4b6161.tar.xz
linux-8372e24aca862ae1fdd54a442fba92dc9b4b6161.zip
Merging upstream version 6.1.90.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'net/unix/scm.c')
-rw-r--r--net/unix/scm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/unix/scm.c b/net/unix/scm.c
index d1048b4c2..4eff7da9f 100644
--- a/net/unix/scm.c
+++ b/net/unix/scm.c
@@ -52,12 +52,13 @@ void unix_inflight(struct user_struct *user, struct file *fp)
if (s) {
struct unix_sock *u = unix_sk(s);
- if (atomic_long_inc_return(&u->inflight) == 1) {
+ if (!u->inflight) {
BUG_ON(!list_empty(&u->link));
list_add_tail(&u->link, &gc_inflight_list);
} else {
BUG_ON(list_empty(&u->link));
}
+ u->inflight++;
/* Paired with READ_ONCE() in wait_for_unix_gc() */
WRITE_ONCE(unix_tot_inflight, unix_tot_inflight + 1);
}
@@ -74,10 +75,11 @@ void unix_notinflight(struct user_struct *user, struct file *fp)
if (s) {
struct unix_sock *u = unix_sk(s);
- BUG_ON(!atomic_long_read(&u->inflight));
+ BUG_ON(!u->inflight);
BUG_ON(list_empty(&u->link));
- if (atomic_long_dec_and_test(&u->inflight))
+ u->inflight--;
+ if (!u->inflight)
list_del_init(&u->link);
/* Paired with READ_ONCE() in wait_for_unix_gc() */
WRITE_ONCE(unix_tot_inflight, unix_tot_inflight - 1);