Commit bda487a
cifs: avoid race during socket reconnect between send and recv
When a TCP connection gets reestablished by the sender in cifs_reconnect,
There is a chance for race condition with demultiplex thread waiting in
cifs_readv_from_socket on the old socket. It will now return -ECONNRESET.
This condition is handled by comparing socket pointer before and after
sock_recvmsg. If the socket pointer has changed, we should not call
cifs_reconnect again, but instead retry with new socket.
Also fixed another bug in my prev mchan commits.
We should always reestablish session (even if binding) on a channel
that needs reconnection.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>1 parent 73f9bfb commit bda487a
3 files changed
Lines changed: 6 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 201 | + | |
206 | 202 | | |
207 | 203 | | |
208 | 204 | | |
209 | 205 | | |
210 | 206 | | |
211 | 207 | | |
212 | | - | |
213 | 208 | | |
214 | 209 | | |
215 | 210 | | |
| |||
223 | 218 | | |
224 | 219 | | |
225 | 220 | | |
226 | | - | |
227 | | - | |
228 | 221 | | |
229 | 222 | | |
230 | 223 | | |
231 | 224 | | |
232 | | - | |
| 225 | + | |
233 | 226 | | |
234 | 227 | | |
235 | | - | |
236 | 228 | | |
237 | 229 | | |
238 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | 279 | | |
281 | 280 | | |
282 | 281 | | |
| |||
3858 | 3857 | | |
3859 | 3858 | | |
3860 | 3859 | | |
3861 | | - | |
| 3860 | + | |
3862 | 3861 | | |
3863 | 3862 | | |
3864 | 3863 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1057 | 1057 | | |
1058 | 1058 | | |
1059 | 1059 | | |
1060 | | - | |
1061 | 1060 | | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
| 1061 | + | |
| 1062 | + | |
1072 | 1063 | | |
1073 | 1064 | | |
1074 | 1065 | | |
| |||
0 commit comments