aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rds/send.c')
-rw-r--r--net/rds/send.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/rds/send.c b/net/rds/send.c
index e81aa176f4e2..41b9f0f5bb9c 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -170,8 +170,8 @@ restart:
170 * The acquire_in_xmit() check above ensures that only one 170 * The acquire_in_xmit() check above ensures that only one
171 * caller can increment c_send_gen at any time. 171 * caller can increment c_send_gen at any time.
172 */ 172 */
173 cp->cp_send_gen++; 173 send_gen = READ_ONCE(cp->cp_send_gen) + 1;
174 send_gen = cp->cp_send_gen; 174 WRITE_ONCE(cp->cp_send_gen, send_gen);
175 175
176 /* 176 /*
177 * rds_conn_shutdown() sets the conn state and then tests RDS_IN_XMIT, 177 * rds_conn_shutdown() sets the conn state and then tests RDS_IN_XMIT,
@@ -431,7 +431,7 @@ over_batch:
431 smp_mb(); 431 smp_mb();
432 if ((test_bit(0, &conn->c_map_queued) || 432 if ((test_bit(0, &conn->c_map_queued) ||
433 !list_empty(&cp->cp_send_queue)) && 433 !list_empty(&cp->cp_send_queue)) &&
434 send_gen == cp->cp_send_gen) { 434 send_gen == READ_ONCE(cp->cp_send_gen)) {
435 rds_stats_inc(s_send_lock_queue_raced); 435 rds_stats_inc(s_send_lock_queue_raced);
436 if (batch_count < send_batch_count) 436 if (batch_count < send_batch_count)
437 goto restart; 437 goto restart;