@@ -492,7 +492,7 @@ static int reconnect_target_locked(struct TCP_Server_Info *server,
492
492
static int reconnect_dfs_server (struct TCP_Server_Info * server )
493
493
{
494
494
struct dfs_cache_tgt_iterator * target_hint = NULL ;
495
-
495
+ const char * ref_path = server -> leaf_fullpath + 1 ;
496
496
DFS_CACHE_TGT_LIST (tl );
497
497
int num_targets = 0 ;
498
498
int rc = 0 ;
@@ -505,10 +505,8 @@ static int reconnect_dfs_server(struct TCP_Server_Info *server)
505
505
* through /proc/fs/cifs/dfscache or the target list is empty due to server settings after
506
506
* refreshing the referral, so, in this case, default it to 1.
507
507
*/
508
- mutex_lock (& server -> refpath_lock );
509
- if (!dfs_cache_noreq_find (server -> leaf_fullpath + 1 , NULL , & tl ))
508
+ if (!dfs_cache_noreq_find (ref_path , NULL , & tl ))
510
509
num_targets = dfs_cache_get_nr_tgts (& tl );
511
- mutex_unlock (& server -> refpath_lock );
512
510
if (!num_targets )
513
511
num_targets = 1 ;
514
512
@@ -552,9 +550,7 @@ static int reconnect_dfs_server(struct TCP_Server_Info *server)
552
550
mod_delayed_work (cifsiod_wq , & server -> reconnect , 0 );
553
551
} while (server -> tcpStatus == CifsNeedReconnect );
554
552
555
- mutex_lock (& server -> refpath_lock );
556
- dfs_cache_noreq_update_tgthint (server -> leaf_fullpath + 1 , target_hint );
557
- mutex_unlock (& server -> refpath_lock );
553
+ dfs_cache_noreq_update_tgthint (ref_path , target_hint );
558
554
dfs_cache_free_tgts (& tl );
559
555
560
556
/* Need to set up echo worker again once connection has been established */
@@ -569,13 +565,8 @@ static int reconnect_dfs_server(struct TCP_Server_Info *server)
569
565
570
566
int cifs_reconnect (struct TCP_Server_Info * server , bool mark_smb_session )
571
567
{
572
- mutex_lock (& server -> refpath_lock );
573
- if (!server -> leaf_fullpath ) {
574
- mutex_unlock (& server -> refpath_lock );
568
+ if (!server -> leaf_fullpath )
575
569
return __cifs_reconnect (server , mark_smb_session );
576
- }
577
- mutex_unlock (& server -> refpath_lock );
578
-
579
570
return reconnect_dfs_server (server );
580
571
}
581
572
#else
@@ -1754,9 +1745,6 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
1754
1745
INIT_DELAYED_WORK (& tcp_ses -> echo , cifs_echo_request );
1755
1746
INIT_DELAYED_WORK (& tcp_ses -> reconnect , smb2_reconnect_server );
1756
1747
mutex_init (& tcp_ses -> reconnect_mutex );
1757
- #ifdef CONFIG_CIFS_DFS_UPCALL
1758
- mutex_init (& tcp_ses -> refpath_lock );
1759
- #endif
1760
1748
memcpy (& tcp_ses -> srcaddr , & ctx -> srcaddr ,
1761
1749
sizeof (tcp_ses -> srcaddr ));
1762
1750
memcpy (& tcp_ses -> dstaddr , & ctx -> dstaddr ,
0 commit comments