@@ -95,25 +95,22 @@ static int get_session(struct cifs_mount_ctx *mnt_ctx, const char *full_path)
9595 ctx -> leaf_fullpath = (char * )full_path ;
9696 rc = cifs_mount_get_session (mnt_ctx );
9797 ctx -> leaf_fullpath = NULL ;
98- if (!rc ) {
99- struct cifs_ses * ses = mnt_ctx -> ses ;
10098
101- mutex_lock (& ses -> session_mutex );
102- ses -> dfs_root_ses = mnt_ctx -> root_ses ;
103- mutex_unlock (& ses -> session_mutex );
104- }
10599 return rc ;
106100}
107101
108102static void set_root_ses (struct cifs_mount_ctx * mnt_ctx )
109103{
110- if (mnt_ctx -> ses ) {
104+ struct smb3_fs_context * ctx = mnt_ctx -> fs_ctx ;
105+ struct cifs_ses * ses = mnt_ctx -> ses ;
106+
107+ if (ses ) {
111108 spin_lock (& cifs_tcp_ses_lock );
112- mnt_ctx -> ses -> ses_count ++ ;
109+ ses -> ses_count ++ ;
113110 spin_unlock (& cifs_tcp_ses_lock );
114- dfs_cache_add_refsrv_session (& mnt_ctx -> mount_id , mnt_ctx -> ses );
111+ dfs_cache_add_refsrv_session (& mnt_ctx -> mount_id , ses );
115112 }
116- mnt_ctx -> root_ses = mnt_ctx -> ses ;
113+ ctx -> dfs_root_ses = mnt_ctx -> ses ;
117114}
118115
119116static int get_dfs_conn (struct cifs_mount_ctx * mnt_ctx , const char * ref_path , const char * full_path ,
@@ -260,7 +257,7 @@ int dfs_mount_share(struct cifs_mount_ctx *mnt_ctx, bool *isdfs)
260257 rc = get_session (mnt_ctx , NULL );
261258 if (rc )
262259 return rc ;
263- mnt_ctx -> root_ses = mnt_ctx -> ses ;
260+ ctx -> dfs_root_ses = mnt_ctx -> ses ;
264261 /*
265262 * If called with 'nodfs' mount option, then skip DFS resolving. Otherwise unconditionally
266263 * try to get an DFS referral (even cached) to determine whether it is an DFS mount.
0 commit comments