@@ -2188,12 +2188,14 @@ void ksocknal_write_callback(struct ksock_conn *conn)
/* We're called with a shared lock on ksnd_global_lock */
struct ksock_conn *conn;
struct ksock_tx *tx;
+ struct ksock_sched *sched;
list_for_each_entry(conn, &peer_ni->ksnp_conns, ksnc_list) {
int error;
/* Don't need the {get,put}connsock dance to deref ksnc_sock */
LASSERT(!conn->ksnc_closing);
+ sched = conn->ksnc_scheduler;
error = conn->ksnc_sock->sk->sk_err;
if (error) {
@@ -2234,6 +2236,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)
return conn;
}
+ spin_lock_bh(&sched->kss_lock);
if ((!list_empty(&conn->ksnc_tx_queue) ||
conn->ksnc_sock->sk->sk_wmem_queued) &&
ktime_get_seconds() >= conn->ksnc_tx_deadline) {
@@ -2249,8 +2252,10 @@ void ksocknal_write_callback(struct ksock_conn *conn)
CNETERR("Timeout sending data to %s (%pISp) the network or that node may be down.\n",
libcfs_idstr(&peer_ni->ksnp_id),
&conn->ksnc_peeraddr);
+ spin_unlock_bh(&sched->kss_lock);
return conn;
}
+ spin_unlock_bh(&sched->kss_lock);
}
return NULL;