Skip to content

Commit a68106a

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: translate network errors on send to -ECONNABORTED
When the network stack returns various errors, we today bubble up the error to the user (in case of soft mounts). This change translates all network errors except -EINTR and -EAGAIN to -ECONNABORTED. A similar approach is taken when we receive network errors when reading from the socket. The change also forces the cifsd thread to reconnect during it's next activity. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent fc43a8a commit a68106a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

fs/smb/client/transport.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,17 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
400400
server->conn_id, server->hostname);
401401
}
402402
smbd_done:
403-
if (rc < 0 && rc != -EINTR)
403+
/*
404+
* there's hardly any use for the layers above to know the
405+
* actual error code here. All they should do at this point is
406+
* to retry the connection and hope it goes away.
407+
*/
408+
if (rc < 0 && rc != -EINTR && rc != -EAGAIN) {
404409
cifs_server_dbg(VFS, "Error %d sending data on socket to server\n",
405410
rc);
406-
else if (rc > 0)
411+
rc = -ECONNABORTED;
412+
cifs_signal_cifsd_for_reconnect(server, false);
413+
} else if (rc > 0)
407414
rc = 0;
408415
out:
409416
cifs_in_send_dec(server);

0 commit comments

Comments
 (0)