Skip to content

Commit

Permalink
CIFS: Return -EAGAIN instead of -ENOTSOCK
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
piastry authored and Steve French committed Mar 6, 2019
1 parent 2084ed5 commit afc18a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/cifs/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit afc18a6

Please sign in to comment.