diff options
author | Paulo Alcantara <pc@cjr.nz> | 2022-11-17 19:23:49 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-12-19 17:03:12 +0300 |
commit | a1c0d00572fca4adcb40e1fbd3acd481fc75e20b (patch) | |
tree | 59d17b23729687930bc2d9d2b7ff28d636dc1cdb /fs/cifs/dfs_cache.c | |
parent | a73a26d97eca082fe13c964e5541543c1e78dc55 (diff) | |
download | linux-a1c0d00572fca4adcb40e1fbd3acd481fc75e20b.tar.xz |
cifs: share dfs connections and supers
When matching DFS superblocks we can't rely on either the server's
address or tcon's UNC name from mount(2) as the existing servers and
tcons might be connected to somewhere else. Instead, check if
superblock is dfs, and if so, match its original source pathname with
the new mount's source pathname.
For DFS connections, instead of checking server's address, match its
referral path as it could be connected to different targets.
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/dfs_cache.c')
-rw-r--r-- | fs/cifs/dfs_cache.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c index 17b6d533c966..bf5e674f43b8 100644 --- a/fs/cifs/dfs_cache.c +++ b/fs/cifs/dfs_cache.c @@ -1519,12 +1519,8 @@ static void refresh_mounts(struct cifs_ses **sessions) spin_lock(&cifs_tcp_ses_lock); list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) { - spin_lock(&server->srv_lock); - if (!server->is_dfs_conn) { - spin_unlock(&server->srv_lock); + if (!server->leaf_fullpath) continue; - } - spin_unlock(&server->srv_lock); list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { @@ -1545,12 +1541,8 @@ static void refresh_mounts(struct cifs_ses **sessions) list_del_init(&tcon->ulist); mutex_lock(&server->refpath_lock); - if (server->origin_fullpath) { - if (server->leaf_fullpath && strcasecmp(server->leaf_fullpath, - server->origin_fullpath)) - __refresh_tcon(server->leaf_fullpath + 1, sessions, tcon, false); - __refresh_tcon(server->origin_fullpath + 1, sessions, tcon, false); - } + if (server->leaf_fullpath) + __refresh_tcon(server->leaf_fullpath + 1, sessions, tcon, false); mutex_unlock(&server->refpath_lock); cifs_put_tcon(tcon); |