Skip to content

Commit 442888d

Browse files
committed
cifs: translate network errors on send to -ECONNABORTED
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.31.1.el9_4 commit-author Shyam Prasad N <sprasad@microsoft.com> commit a68106a 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> (cherry picked from commit a68106a) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent cdf62e5 commit 442888d

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
@@ -436,10 +436,17 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
436436
server->conn_id, server->hostname);
437437
}
438438
smbd_done:
439-
if (rc < 0 && rc != -EINTR)
439+
/*
440+
* there's hardly any use for the layers above to know the
441+
* actual error code here. All they should do at this point is
442+
* to retry the connection and hope it goes away.
443+
*/
444+
if (rc < 0 && rc != -EINTR && rc != -EAGAIN) {
440445
cifs_server_dbg(VFS, "Error %d sending data on socket to server\n",
441446
rc);
442-
else if (rc > 0)
447+
rc = -ECONNABORTED;
448+
cifs_signal_cifsd_for_reconnect(server, false);
449+
} else if (rc > 0)
443450
rc = 0;
444451
out:
445452
cifs_in_send_dec(server);

0 commit comments

Comments
 (0)