Merge branch 'smc-fixes'
Dust Li says:
====================
net/smc: fix kernel panic caused by race of smc_sock
This patchset fixes the race between smc_release triggered by
close(2) and cdc_handle triggered by underlaying RDMA device.
The race is caused because the smc_connection may been released
before the pending tx CDC messages got its CQEs. In order to fix
this, I add a counter to track how many pending WRs we have posted
through the smc_connection, and only release the smc_connection
after there is no pending WRs on the connection.
The first patch prevents posting WR on a QP that is not in RTS
state. This patch is needed because if we post WR on a QP that
is not in RTS state, ib_post_send() may success but no CQE will
return, and that will confuse the counter tracking the pending
WRs.
The second patch add a counter to track how many WRs were posted
through the smc_connection, and don't reset the QP on link destroying
to prevent leak of the counter.
====================
Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- net/smc/smc.h 5 additions, 0 deletionsnet/smc/smc.h
- net/smc/smc_cdc.c 24 additions, 28 deletionsnet/smc/smc_cdc.c
- net/smc/smc_cdc.h 1 addition, 1 deletionnet/smc/smc_cdc.h
- net/smc/smc_core.c 21 additions, 6 deletionsnet/smc/smc_core.c
- net/smc/smc_core.h 6 additions, 0 deletionsnet/smc/smc_core.h
- net/smc/smc_ib.c 2 additions, 2 deletionsnet/smc/smc_ib.c
- net/smc/smc_ib.h 1 addition, 0 deletionsnet/smc/smc_ib.h
- net/smc/smc_llc.c 1 addition, 1 deletionnet/smc/smc_llc.c
- net/smc/smc_wr.c 5 additions, 40 deletionsnet/smc/smc_wr.c
- net/smc/smc_wr.h 2 additions, 3 deletionsnet/smc/smc_wr.h
Please register or sign in to comment