summaryrefslogtreecommitdiff
path: root/net/unix
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2024-05-02 13:12:31 +0200
committerIngo Molnar <mingo@kernel.org>2024-05-02 13:12:31 +0200
commitad112b3a759cefc245695f7e612f17e6f38d2cc1 (patch)
treed5fa837d0f996dbf15e4fd89a7f89b9b660f5796 /net/unix
parent854dd99b5ddc9d90e31e5f112462a5994dd31810 (diff)
parente67572cd2204894179d89bd7b984072f19313b03 (diff)
Merge tag 'v6.9-rc6' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c12
-rw-r--r--net/unix/garbage.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index d032eb5fa6df..9a6ad5974dff 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2663,7 +2663,9 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk,
WRITE_ONCE(u->oob_skb, NULL);
consume_skb(skb);
}
- } else if (!(flags & MSG_PEEK)) {
+ } else if (flags & MSG_PEEK) {
+ skb = NULL;
+ } else {
skb_unlink(skb, &sk->sk_receive_queue);
WRITE_ONCE(u->oob_skb, NULL);
if (!WARN_ON_ONCE(skb_unref(skb)))
@@ -2741,18 +2743,16 @@ redo:
last = skb = skb_peek(&sk->sk_receive_queue);
last_len = last ? last->len : 0;
+again:
#if IS_ENABLED(CONFIG_AF_UNIX_OOB)
if (skb) {
skb = manage_oob(skb, sk, flags, copied);
- if (!skb) {
+ if (!skb && copied) {
unix_state_unlock(sk);
- if (copied)
- break;
- goto redo;
+ break;
}
}
#endif
-again:
if (skb == NULL) {
if (copied >= target)
goto unlock;
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index 6433a414acf8..0104be9d4704 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -299,7 +299,7 @@ static void __unix_gc(struct work_struct *work)
__set_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags);
if (sk->sk_state == TCP_LISTEN) {
- unix_state_lock(sk);
+ unix_state_lock_nested(sk, U_LOCK_GC_LISTENER);
unix_state_unlock(sk);
}
}