smb: server: let free_transport() wait for SMBDIRECT_SOCKET_DISCONNECTED
Subsystems (3)
Stefan Metzmacher
reviewerPATCH 1/1 smb: server: let free_transport() wait for SMBDIRECT_SOCKET_DISCONNECTED
We should wait for the rdma_cm to become SMBDIRECT_SOCKET_DISCONNECTED!
At least on the client side (with similar code) wait_event_interruptible() often returns with -ERESTARTSYS instead of waiting for SMBDIRECT_SOCKET_DISCONNECTED.
We should use wait_event() here too, which makes the code be identical in client and server, which will help when moving to common functions.
--- fs/smb/server/transport_rdma.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
fs/smb/server/transport_rdma.c +3 -4
@@ -450,11 +450,10 @@ static void free_transport(struct smb_direct_transport *t)struct smbdirect_recv_io *recvmsg;disable_work_sync (&sc->disconnect_work); -if (sc->status <SMBDIRECT_SOCKET_DISCONNECTING ) { +if (sc->status <SMBDIRECT_SOCKET_DISCONNECTING )smb_direct_disconnect_rdma_work (&sc->disconnect_work); -wait_event_interruptible (sc->status_wait, - sc->status ==SMBDIRECT_SOCKET_DISCONNECTED ); - } +if (sc->status <SMBDIRECT_SOCKET_DISCONNECTED ) +wait_event (sc->status_wait, sc->status ==SMBDIRECT_SOCKET_DISCONNECTED );/* * Wake up all waiters in all wait queues
Signature · 1 line
2.43.0
Quoted 9 lines · Stefan Metzmacher
We should wait for the
rdma_cmto becomeSMBDIRECT_SOCKET_DISCONNECTED!At least on the client side (with similar code)
wait_event_interruptible()often returns with-ERESTARTSYSinstead of waiting forSMBDIRECT_SOCKET_DISCONNECTED.
We should usewait_event()here too, which makes the code be identical in client and server, which will help when moving to common functions.
Quoted 7 lines
Fixes b31606097de8 ("smb: server: move smb_direct_disconnect_rdma_work() into free_transport()")Cc Namjae Jeon <[email protected]>Cc Steve French <[email protected]>Cc Tom Talpey <[email protected]>Signed-off-by Stefan Metzmacher <[email protected]>
Applied it to #ksmbd-for-next-next.
Thanks!