]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/tcp.c
Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[karo-tx-linux.git] / net / ipv4 / tcp.c
index 18e3a12eb1b283bd370bdb4c16f5969e30bcec15..8c5cd9efebbcfa877fedb49dda67e3d098ccbbc1 100644 (file)
@@ -520,8 +520,10 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
 
                                /* Race breaker. If space is freed after
                                 * wspace test but before the flags are set,
-                                * IO signal will be lost.
+                                * IO signal will be lost. Memory barrier
+                                * pairs with the input side.
                                 */
+                               smp_mb__after_atomic();
                                if (sk_stream_is_writeable(sk))
                                        mask |= POLLOUT | POLLWRNORM;
                        }
@@ -2595,6 +2597,7 @@ void tcp_get_info(const struct sock *sk, struct tcp_info *info)
        const struct tcp_sock *tp = tcp_sk(sk);
        const struct inet_connection_sock *icsk = inet_csk(sk);
        u32 now = tcp_time_stamp;
+       u32 rate;
 
        memset(info, 0, sizeof(*info));
 
@@ -2655,10 +2658,11 @@ void tcp_get_info(const struct sock *sk, struct tcp_info *info)
 
        info->tcpi_total_retrans = tp->total_retrans;
 
-       info->tcpi_pacing_rate = sk->sk_pacing_rate != ~0U ?
-                                       sk->sk_pacing_rate : ~0ULL;
-       info->tcpi_max_pacing_rate = sk->sk_max_pacing_rate != ~0U ?
-                                       sk->sk_max_pacing_rate : ~0ULL;
+       rate = READ_ONCE(sk->sk_pacing_rate);
+       info->tcpi_pacing_rate = rate != ~0U ? rate : ~0ULL;
+
+       rate = READ_ONCE(sk->sk_max_pacing_rate);
+       info->tcpi_max_pacing_rate = rate != ~0U ? rate : ~0ULL;
 }
 EXPORT_SYMBOL_GPL(tcp_get_info);