diff options
| -rw-r--r-- | fs/smb/client/connect.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 2f94d93b95e9..26023a870202 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -398,6 +398,20 @@ static int __cifs_reconnect(struct TCP_Server_Info *server, try_to_freeze(); cifs_server_lock(server); + /* + * Servers might disconnect us when they can't decompress a compressed request we + * sent. + * When this happens, as a failsafe measure, disable compression entirely to avoid + * an endless retry. + * + * TODO: implement a more flexible alternative, e.g. identify and retry sending the + * failed request uncompressed, without having to disable compression entirely. + */ + if (server->compression.enabled) { + cifs_server_dbg(VFS | ONCE, "disabling compression (failsafe)\n"); + memset(&server->compression, 0, sizeof(server->compression)); + } + if (!cifs_swn_set_server_dstaddr(server) && !SERVER_IS_CHAN(server)) { /* resolve the hostname again to make sure that IP address is up-to-date */ |
