Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-15076

Add locking to ksocknal_find_timed_out_conn() for safe ksnc_tx_queue list processing

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.15.0
    • None
    • 3
    • 9223372036854775807

    Description

      GFP happened in this peice of code from ksocknal_find_timed_out_conn():

       if ((!list_empty(&conn->ksnc_tx_queue) ||
                           conn->ksnc_sock->sk->sk_wmem_queued != 0) &&
                          ktime_get_seconds() >= conn->ksnc_tx_deadline) {
                              /* Timed out messages queued for sending or
                               * buffered in the socket's send buffer */
                              ksocknal_conn_addref(conn);
                              list_for_each_entry(tx, &conn->ksnc_tx_queue,
                                                  tx_list)
                                      tx->tx_hstatus = <----GFP here
                                              LNET_MSG_STATUS_LOCAL_TIMEOUT; \{code}
      
      
      It looks like ksnc_tx_queue processing requires some additional locking.
      For instance, like it done in ksocknal_write_callback():
      

      spin_lock_bh(&sched->kss_lock);
      ...
      if (!conn->ksnc_tx_scheduled && /* not being progressed */
                  !list_empty(&conn->ksnc_tx_queue)) { /* packets to send */
                      list_add_tail(&conn->ksnc_tx_list, &sched->kss_tx_conns);
      ...
      spin_unlock_bh(&sched->kss_lock);

      
      

      Attachments

        Activity

          People

            artem_blagodarenko Artem Blagodarenko (Inactive)
            artem_blagodarenko Artem Blagodarenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: