CIFS: Return -EAGAIN instead of -ENOTSOCK
authorPavel Shilovsky <piastryyy@gmail.com>
Tue, 5 Mar 2019 23:51:56 +0000 (15:51 -0800)
committerSteve French <stfrench@microsoft.com>
Wed, 6 Mar 2019 00:14:39 +0000 (18:14 -0600)
When we attempt to send a packet while the demultiplex thread
is in the middle of cifs_reconnect() we may end up returning
-ENOTSOCK to upper layers. The intent here is to retry the request
once the TCP connection is up, so change it to return -EAGAIN
instead. The latter error code is retryable and the upper layers
will retry the request if needed.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/transport.c

index 9c3a680..9f23a45 100644 (file)
@@ -301,8 +301,9 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
                rc = smbd_send(server, rqst);
                goto smbd_done;
        }
+
        if (ssocket == NULL)
-               return -ENOTSOCK;
+               return -EAGAIN;
 
        /* cork the socket */
        kernel_setsockopt(ssocket, SOL_TCP, TCP_CORK,