|
| 1 | +cifs: force interface update before a fresh session setup |
| 2 | + |
| 3 | +jira LE-4669 |
| 4 | +Rebuild_History Non-Buildable kernel-4.18.0-553.82.1.el8_10 |
| 5 | +commit-author Shyam Prasad N <sprasad@microsoft.com> |
| 6 | +commit d9a6d78096056a3cb5c5f07a730ab92f2f9ac4e6 |
| 7 | +Empty-Commit: Cherry-Pick Conflicts during history rebuild. |
| 8 | +Will be included in final tarball splat. Ref for failed cherry-pick at: |
| 9 | +ciq/ciq_backports/kernel-4.18.0-553.82.1.el8_10/d9a6d780.failed |
| 10 | + |
| 11 | +During a session reconnect, it is possible that the |
| 12 | +server moved to another physical server (happens in case |
| 13 | +of Azure files). So at this time, force a query of server |
| 14 | +interfaces again (in case of multichannel session), such |
| 15 | +that the secondary channels connect to the right |
| 16 | +IP addresses (possibly updated now). |
| 17 | + |
| 18 | + Cc: stable@vger.kernel.org |
| 19 | + Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> |
| 20 | + Signed-off-by: Steve French <stfrench@microsoft.com> |
| 21 | +(cherry picked from commit d9a6d78096056a3cb5c5f07a730ab92f2f9ac4e6) |
| 22 | + Signed-off-by: Jonathan Maple <jmaple@ciq.com> |
| 23 | + |
| 24 | +# Conflicts: |
| 25 | +# fs/cifs/connect.c |
| 26 | +diff --cc fs/cifs/connect.c |
| 27 | +index ca2926c7b59e,1a137b33858a..000000000000 |
| 28 | +--- a/fs/cifs/connect.c |
| 29 | ++++ b/fs/cifs/connect.c |
| 30 | +@@@ -3965,6 -3840,31 +3965,25 @@@ cifs_setup_session(const unsigned int x |
| 31 | + is_binding = !CIFS_ALL_CHANS_NEED_RECONNECT(ses); |
| 32 | + spin_unlock(&ses->chan_lock); |
| 33 | + |
| 34 | +++<<<<<<< HEAD:fs/cifs/connect.c |
| 35 | +++======= |
| 36 | ++ if (!is_binding) { |
| 37 | ++ ses->ses_status = SES_IN_SETUP; |
| 38 | ++ |
| 39 | ++ /* force iface_list refresh */ |
| 40 | ++ ses->iface_last_update = 0; |
| 41 | ++ } |
| 42 | ++ spin_unlock(&ses->ses_lock); |
| 43 | ++ |
| 44 | ++ /* update ses ip_addr only for primary chan */ |
| 45 | ++ if (server == pserver) { |
| 46 | ++ if (server->dstaddr.ss_family == AF_INET6) |
| 47 | ++ scnprintf(ses->ip_addr, sizeof(ses->ip_addr), "%pI6", &addr6->sin6_addr); |
| 48 | ++ else |
| 49 | ++ scnprintf(ses->ip_addr, sizeof(ses->ip_addr), "%pI4", &addr->sin_addr); |
| 50 | ++ } |
| 51 | ++ |
| 52 | +++>>>>>>> d9a6d7809605 (cifs: force interface update before a fresh session setup):fs/smb/client/connect.c |
| 53 | + if (!is_binding) { |
| 54 | + ses->capabilities = server->capabilities; |
| 55 | + if (!linuxExtEnabled) |
| 56 | +* Unmerged path fs/cifs/connect.c |
0 commit comments