diff mbox

[2/2,SMB3] Avoid possible deadlock in previous patch

Message ID 1466742647-9805-2-git-send-email-smfrench@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steve French June 24, 2016, 4:30 a.m. UTC
Signed-off-by: Steve French <steve.french@primarydata.com>
---
 fs/cifs/smb2pdu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 4030cbd..f2cbb28 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1831,8 +1831,11 @@  SMB2_echo(struct TCP_Server_Info *server)
 				tcon = list_entry(tmp2, struct cifs_tcon,
 						  tcon_list);
 				/* add check for persistent handle reconnect */
-				if (tcon && tcon->need_reconnect)
+				if (tcon && tcon->need_reconnect) {
+					spin_unlock(&cifs_tcp_ses_lock);
 					rc = smb2_reconnect(SMB2_ECHO, tcon);
+					spin_lock(&cifs_tcp_ses_lock);
+				}
 			}
 		}
 		spin_unlock(&cifs_tcp_ses_lock);