* [PATCH] cifs: fix hang on cifs_get_next_mid()
@ 2022-01-07 22:51 Enzo Matsumiya
2022-01-08 2:09 ` Steve French
0 siblings, 1 reply; 2+ messages in thread
From: Enzo Matsumiya @ 2022-01-07 22:51 UTC (permalink / raw)
To: linux-cifs; +Cc: smfrench, nspmangalore, pc, Enzo Matsumiya
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: 220c5bc25d87 ("cifs: take cifs_tcp_ses_lock for status checks")
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
---
fs/cifs/smb1ops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 54319a789c92..6364c09296e8 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -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);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cifs: fix hang on cifs_get_next_mid()
2022-01-07 22:51 [PATCH] cifs: fix hang on cifs_get_next_mid() Enzo Matsumiya
@ 2022-01-08 2:09 ` Steve French
0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2022-01-08 2:09 UTC (permalink / raw)
To: Enzo Matsumiya; +Cc: CIFS, Shyam Prasad N, Paulo Alcantara
tentatively merged into cifs-2.6.git for-next pending testing
On Fri, Jan 7, 2022 at 4:51 PM Enzo Matsumiya <ematsumiya@suse.de> wrote:
>
> 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: 220c5bc25d87 ("cifs: take cifs_tcp_ses_lock for status checks")
> Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
> ---
> fs/cifs/smb1ops.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
> index 54319a789c92..6364c09296e8 100644
> --- a/fs/cifs/smb1ops.c
> +++ b/fs/cifs/smb1ops.c
> @@ -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);
>
> --
> 2.34.1
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-08 2:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 22:51 [PATCH] cifs: fix hang on cifs_get_next_mid() Enzo Matsumiya
2022-01-08 2:09 ` Steve French
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).