Skip to content

Commit 36bb22a

Browse files
Gleb KorobeynikovSteve French
authored andcommitted
cifs: cifs_inval_name_dfs_link_error: correct the check for fullpath
Replace the always-true check tcon->origin_fullpath with check of server->leaf_fullpath See https://bugzilla.kernel.org/show_bug.cgi?id=219083 The check of the new @tcon will always be true during mounting, since @tcon->origin_fullpath will only be set after the tree is connected to the latest common resource, as well as checking if the prefix paths from it are fully accessible. Fixes: 3ae872d ("smb: client: fix shared DFS root mounts with different prefixes") Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Gleb Korobeynikov <gkorobeynikov@astralinux.ru> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent bdcffe4 commit 36bb22a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/smb/client/misc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,7 @@ int cifs_inval_name_dfs_link_error(const unsigned int xid,
12341234
const char *full_path,
12351235
bool *islink)
12361236
{
1237+
struct TCP_Server_Info *server = tcon->ses->server;
12371238
struct cifs_ses *ses = tcon->ses;
12381239
size_t len;
12391240
char *path;
@@ -1250,12 +1251,12 @@ int cifs_inval_name_dfs_link_error(const unsigned int xid,
12501251
!is_tcon_dfs(tcon))
12511252
return 0;
12521253

1253-
spin_lock(&tcon->tc_lock);
1254-
if (!tcon->origin_fullpath) {
1255-
spin_unlock(&tcon->tc_lock);
1254+
spin_lock(&server->srv_lock);
1255+
if (!server->leaf_fullpath) {
1256+
spin_unlock(&server->srv_lock);
12561257
return 0;
12571258
}
1258-
spin_unlock(&tcon->tc_lock);
1259+
spin_unlock(&server->srv_lock);
12591260

12601261
/*
12611262
* Slow path - tcon is DFS and @full_path has prefix path, so attempt

0 commit comments

Comments
 (0)