]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: receive returns without data
authorKarsten Graul <kgraul@linux.ibm.com>
Thu, 10 Oct 2019 08:16:10 +0000 (10:16 +0200)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 11 Oct 2019 02:08:41 +0000 (19:08 -0700)
commit67c13f7b16f0aa8a70ea4b50166c9767aa240bc3
tree7f11be8258d79a3d48af2953b66eb796e2d3651b
parent87633ee60542fe4839202d1e858ce553fce93188
net/smc: receive returns without data

smc_cdc_rxed_any_close_or_senddone() is used as an end condition for the
receive loop. This conflicts with smc_cdc_msg_recv_action() which could
run in parallel and set the bits checked by
smc_cdc_rxed_any_close_or_senddone() before the receive is processed.
In that case we could return from receive with no data, although data is
available. The same applies to smc_rx_wait().
Fix this by checking for RCV_SHUTDOWN only, which is set in
smc_cdc_msg_recv_action() after the receive was actually processed.

Fixes: 7af079a7a4b6 ("smc: receive data from RMBE")
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
net/smc/smc_rx.c