diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 6771d0146dfc86..38bced5bc4130c 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -380,6 +380,7 @@ cifs_reconnect(struct TCP_Server_Info *server) try_to_freeze(); /* we should try only the port we connected to before */ + mutex_lock(&server->srv_mutex); rc = generic_ip_connect(server); if (rc) { cFYI(1, "reconnect error %d", rc); @@ -391,6 +392,7 @@ cifs_reconnect(struct TCP_Server_Info *server) server->tcpStatus = CifsNeedNegotiate; spin_unlock(&GlobalMid_Lock); } + mutex_unlock(&server->srv_mutex); } while (server->tcpStatus == CifsNeedReconnect); return rc;