Skip to content

Commit

Permalink
cifs: fix hang on cifs_get_next_mid()
Browse files Browse the repository at this point in the history
Mount will hang if using SMB1 and DFS.

This is because every call to get_next_mid() will, unconditionally,
mark tcpStatus to CifsNeedReconnect before even establishing the
initial connect, because "reconnect" variable was not initialized.

Initializing "reconnect" to false fix this issue.

Fixes: 220c5bc ("cifs: take cifs_tcp_ses_lock for status checks")
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Enzo Matsumiya authored and Steve French committed Jan 8, 2022
1 parent 080dc5e commit 1913e11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/smb1ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ cifs_get_next_mid(struct TCP_Server_Info *server)
{
__u64 mid = 0;
__u16 last_mid, cur_mid;
bool collision, reconnect;
bool collision, reconnect = false;

spin_lock(&GlobalMid_Lock);

Expand Down

0 comments on commit 1913e11

Please sign in to comment.