]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: smbd: Return -EAGAIN when transport is reconnecting
authorLong Li <longli@microsoft.com>
Wed, 16 Oct 2019 20:51:56 +0000 (13:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 10:04:41 +0000 (11:04 +0100)
commit 4357d45f50e58672e1d17648d792f27df01dfccd upstream.

During reconnecting, the transport may have already been destroyed and is in
the process being reconnected. In this case, return -EAGAIN to not fail and
to retry this I/O.

Signed-off-by: Long Li <longli@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/transport.c

index ca3de62688d6e8fab18504ef09cc4be5ac9c709a..e9e3a0909ff14c156a172005bec15f20f02cee6e 100644 (file)
@@ -319,8 +319,11 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
        int val = 1;
        __be32 rfc1002_marker;
 
-       if (cifs_rdma_enabled(server) && server->smbd_conn) {
-               rc = smbd_send(server, num_rqst, rqst);
+       if (cifs_rdma_enabled(server)) {
+               /* return -EAGAIN when connecting or reconnecting */
+               rc = -EAGAIN;
+               if (server->smbd_conn)
+                       rc = smbd_send(server, num_rqst, rqst);
                goto smbd_done;
        }