aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 6da9f31366c9..cbac88475b6c 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -2456,6 +2456,7 @@ ksocknal_check_peer_timeouts(int idx)
2456 2456
2457 list_for_each_entry(peer, peers, ksnp_list) { 2457 list_for_each_entry(peer, peers, ksnp_list) {
2458 unsigned long deadline = 0; 2458 unsigned long deadline = 0;
2459 struct ksock_tx *tx_stale;
2459 int resid = 0; 2460 int resid = 0;
2460 int n = 0; 2461 int n = 0;
2461 2462
@@ -2503,6 +2504,7 @@ ksocknal_check_peer_timeouts(int idx)
2503 if (list_empty(&peer->ksnp_zc_req_list)) 2504 if (list_empty(&peer->ksnp_zc_req_list))
2504 continue; 2505 continue;
2505 2506
2507 tx_stale = NULL;
2506 spin_lock(&peer->ksnp_lock); 2508 spin_lock(&peer->ksnp_lock);
2507 list_for_each_entry(tx, &peer->ksnp_zc_req_list, tx_zc_list) { 2509 list_for_each_entry(tx, &peer->ksnp_zc_req_list, tx_zc_list) {
2508 if (!cfs_time_aftereq(cfs_time_current(), 2510 if (!cfs_time_aftereq(cfs_time_current(),
@@ -2511,26 +2513,26 @@ ksocknal_check_peer_timeouts(int idx)
2511 /* ignore the TX if connection is being closed */ 2513 /* ignore the TX if connection is being closed */
2512 if (tx->tx_conn->ksnc_closing) 2514 if (tx->tx_conn->ksnc_closing)
2513 continue; 2515 continue;
2516 if (!tx_stale)
2517 tx_stale = tx;
2514 n++; 2518 n++;
2515 } 2519 }
2516 2520
2517 if (!n) { 2521 if (!tx_stale) {
2518 spin_unlock(&peer->ksnp_lock); 2522 spin_unlock(&peer->ksnp_lock);
2519 continue; 2523 continue;
2520 } 2524 }
2521 2525
2522 tx = list_entry(peer->ksnp_zc_req_list.next, 2526 deadline = tx_stale->tx_deadline;
2523 struct ksock_tx, tx_zc_list); 2527 resid = tx_stale->tx_resid;
2524 deadline = tx->tx_deadline; 2528 conn = tx_stale->tx_conn;
2525 resid = tx->tx_resid;
2526 conn = tx->tx_conn;
2527 ksocknal_conn_addref(conn); 2529 ksocknal_conn_addref(conn);
2528 2530
2529 spin_unlock(&peer->ksnp_lock); 2531 spin_unlock(&peer->ksnp_lock);
2530 read_unlock(&ksocknal_data.ksnd_global_lock); 2532 read_unlock(&ksocknal_data.ksnd_global_lock);
2531 2533
2532 CERROR("Total %d stale ZC_REQs for peer %s detected; the oldest(%p) timed out %ld secs ago, resid: %d, wmem: %d\n", 2534 CERROR("Total %d stale ZC_REQs for peer %s detected; the oldest(%p) timed out %ld secs ago, resid: %d, wmem: %d\n",
2533 n, libcfs_nid2str(peer->ksnp_id.nid), tx, 2535 n, libcfs_nid2str(peer->ksnp_id.nid), tx_stale,
2534 cfs_duration_sec(cfs_time_current() - deadline), 2536 cfs_duration_sec(cfs_time_current() - deadline),
2535 resid, conn->ksnc_sock->sk->sk_wmem_queued); 2537 resid, conn->ksnc_sock->sk->sk_wmem_queued);
2536 2538