hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/net/ipv4/tcp_fastopen.c
....@@ -312,6 +312,7 @@
312312 static bool tcp_fastopen_queue_check(struct sock *sk)
313313 {
314314 struct fastopen_queue *fastopenq;
315
+ int max_qlen;
315316
316317 /* Make sure the listener has enabled fastopen, and we don't
317318 * exceed the max # of pending TFO requests allowed before trying
....@@ -324,10 +325,11 @@
324325 * temporarily vs a server not supporting Fast Open at all.
325326 */
326327 fastopenq = &inet_csk(sk)->icsk_accept_queue.fastopenq;
327
- if (fastopenq->max_qlen == 0)
328
+ max_qlen = READ_ONCE(fastopenq->max_qlen);
329
+ if (max_qlen == 0)
328330 return false;
329331
330
- if (fastopenq->qlen >= fastopenq->max_qlen) {
332
+ if (fastopenq->qlen >= max_qlen) {
331333 struct request_sock *req1;
332334 spin_lock(&fastopenq->lock);
333335 req1 = fastopenq->rskq_rst_head;