summaryrefslogtreecommitdiff
path: root/fs/smb
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@manguebit.com>2024-09-18 02:04:23 -0300
committerSteve French <stfrench@microsoft.com>2024-09-24 21:51:48 -0500
commit0826b134c0b039db4850fb762e79766a45d847c5 (patch)
treeadba912958c110e4318f1d1b425c10aa3a8a8e45 /fs/smb
parent85633c00ad03049019df632f2bdcf5ff7efc7796 (diff)
smb: client: fix DFS failover in multiuser mounts
For sessions and tcons created on behalf of new users accessing a multiuser mount, matching their sessions in tcon_super_cb() with master tcon will always lead to false as every new user will have its own session and tcon. All multiuser sessions, however, will inherit ->dfs_root_ses from master tcon, so match it instead. Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb')
-rw-r--r--fs/smb/client/misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c
index 47b861517bed..054f10ebf65a 100644
--- a/fs/smb/client/misc.c
+++ b/fs/smb/client/misc.c
@@ -1111,7 +1111,8 @@ static void tcon_super_cb(struct super_block *sb, void *arg)
t2 = cifs_sb_master_tcon(cifs_sb);
spin_lock(&t2->tc_lock);
- if (t1->ses == t2->ses &&
+ if ((t1->ses == t2->ses ||
+ t1->ses->dfs_root_ses == t2->ses->dfs_root_ses) &&
t1->ses->server == t2->ses->server &&
t2->origin_fullpath &&
dfs_src_pathname_equal(t2->origin_fullpath, t1->origin_fullpath))