]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net/smc: call smc_cdc_msg_send() under send_lock
authorKarsten Graul <kgraul@linux.ibm.com>
Wed, 30 Jan 2019 17:51:06 +0000 (18:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2019 22:45:45 +0000 (14:45 -0800)
Call smc_cdc_msg_send() under the connection send_lock to make sure all
send operations for one connection are serialized.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_cdc.c

index db83332ac1c8ce285f29e2bcc69e22f203b8afc3..1c5333d494e9a352c582d0793c282f26809a21a3 100644 (file)
@@ -125,7 +125,10 @@ static int smcr_cdc_get_slot_and_msg_send(struct smc_connection *conn)
        if (rc)
                return rc;
 
-       return smc_cdc_msg_send(conn, wr_buf, pend);
+       spin_lock_bh(&conn->send_lock);
+       rc = smc_cdc_msg_send(conn, wr_buf, pend);
+       spin_unlock_bh(&conn->send_lock);
+       return rc;
 }
 
 int smc_cdc_get_slot_and_msg_send(struct smc_connection *conn)