|
43 | 43 | #endif
|
44 | 44 | #include "cached_dir.h"
|
45 | 45 | #include "compress.h"
|
| 46 | +#include "fs_context.h" |
46 | 47 |
|
47 | 48 | /*
|
48 | 49 | * The following table defines the expected "StructureSize" of SMB2 requests
|
@@ -4089,6 +4090,24 @@ smb2_echo_callback(struct mid_q_entry *mid)
|
4089 | 4090 | add_credits(server, &credits, CIFS_ECHO_OP);
|
4090 | 4091 | }
|
4091 | 4092 |
|
| 4093 | +static void cifs_renegotiate_iosize(struct TCP_Server_Info *server, |
| 4094 | + struct cifs_tcon *tcon) |
| 4095 | +{ |
| 4096 | + struct cifs_sb_info *cifs_sb; |
| 4097 | + |
| 4098 | + if (server == NULL || tcon == NULL) |
| 4099 | + return; |
| 4100 | + |
| 4101 | + spin_lock(&tcon->sb_list_lock); |
| 4102 | + list_for_each_entry(cifs_sb, &tcon->cifs_sb_list, tcon_sb_link) { |
| 4103 | + cifs_sb->ctx->rsize = |
| 4104 | + server->ops->negotiate_rsize(tcon, cifs_sb->ctx); |
| 4105 | + cifs_sb->ctx->wsize = |
| 4106 | + server->ops->negotiate_wsize(tcon, cifs_sb->ctx); |
| 4107 | + } |
| 4108 | + spin_unlock(&tcon->sb_list_lock); |
| 4109 | +} |
| 4110 | + |
4092 | 4111 | void smb2_reconnect_server(struct work_struct *work)
|
4093 | 4112 | {
|
4094 | 4113 | struct TCP_Server_Info *server = container_of(work,
|
@@ -4174,9 +4193,10 @@ void smb2_reconnect_server(struct work_struct *work)
|
4174 | 4193 |
|
4175 | 4194 | list_for_each_entry_safe(tcon, tcon2, &tmp_list, rlist) {
|
4176 | 4195 | rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon, server, true);
|
4177 |
| - if (!rc) |
| 4196 | + if (!rc) { |
| 4197 | + cifs_renegotiate_iosize(server, tcon); |
4178 | 4198 | cifs_reopen_persistent_handles(tcon);
|
4179 |
| - else |
| 4199 | + } else |
4180 | 4200 | resched = true;
|
4181 | 4201 | list_del_init(&tcon->rlist);
|
4182 | 4202 | if (tcon->ipc)
|
|
0 commit comments