File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ static inline struct net *tm_net(struct tcp_metrics_block *tm)
59
59
static bool tcp_metric_locked (struct tcp_metrics_block * tm ,
60
60
enum tcp_metric_index idx )
61
61
{
62
- return tm -> tcpm_lock & (1 << idx );
62
+ /* Paired with WRITE_ONCE() in tcpm_suck_dst() */
63
+ return READ_ONCE (tm -> tcpm_lock ) & (1 << idx );
63
64
}
64
65
65
66
static u32 tcp_metric_get (struct tcp_metrics_block * tm ,
@@ -110,7 +111,8 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm,
110
111
val |= 1 << TCP_METRIC_CWND ;
111
112
if (dst_metric_locked (dst , RTAX_REORDERING ))
112
113
val |= 1 << TCP_METRIC_REORDERING ;
113
- tm -> tcpm_lock = val ;
114
+ /* Paired with READ_ONCE() in tcp_metric_locked() */
115
+ WRITE_ONCE (tm -> tcpm_lock , val );
114
116
115
117
msval = dst_metric_raw (dst , RTAX_RTT );
116
118
tm -> tcpm_vals [TCP_METRIC_RTT ] = msval * USEC_PER_MSEC ;
You can’t perform that action at this time.
0 commit comments