Re: [PATCH 2/2] cifs: prevent data race in cifs_reconnect_tcon()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steve French <smfrench@xxxxxxxxx> writes:

>   CHECK   /home/smfrench/cifs-2.6/fs/cifs/smb2pdu.c
> /home/smfrench/cifs-2.6/fs/cifs/smb2pdu.c:204:20: warning: context
> imbalance in 'smb2_reconnect' - unexpected unlock

Thanks.

Please fold this change in

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 62c125e73b73..0e53265e1462 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -185,7 +185,6 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
 
 	spin_lock(&server->srv_lock);
 	if (server->tcpStatus == CifsNeedReconnect) {
-		spin_unlock(&server->srv_lock);
 		/*
 		 * Return to caller for TREE_DISCONNECT and LOGOFF and CLOSE
 		 * here since they are implicitly done when session drops.
@@ -198,6 +197,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
 		case SMB2_CANCEL:
 		case SMB2_CLOSE:
 		case SMB2_OPLOCK_BREAK:
+			spin_unlock(&server->srv_lock);
 			return -EAGAIN;
 		}
 	}



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux