cifs: fix refresh of cached referrals
authorPaulo Alcantara <pc@cjr.nz>
Tue, 13 Dec 2022 04:23:16 +0000 (01:23 -0300)
committerSteve French <stfrench@microsoft.com>
Mon, 19 Dec 2022 14:03:12 +0000 (08:03 -0600)
commit6916881f443f67f6893b504fa2171468c8aed915
tree706aefb2bdbc045f97d071823853fc2b3240d916
parentcb3f6d8764529c33269c3478c17641cb097a615b
cifs: fix refresh of cached referrals

We can't rely on cifs_tcon::ses to refresh cached referral as the
server target might not respond to referrals, e.g. share is not hosted
in a DFS root server.  Consider the following

  mount //dom/dfs/link -> /root1/dfs/link -> /fs0/share

where fs0 can't get a referral for "/root1/dfs/link".

To simplify and fix the access of dfs root sessions, store the dfs
root session pointer directly to new sessions so making it easier to
select the appropriate ipc connection and use it for failover or cache
refresh.

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/dfs.c
fs/cifs/dfs_cache.c