diff mbox series

cifs: double lock in cifs_reconnect_tcon()

Message ID ZC6JEx4dvWUvgcwW@kili (mailing list archive)
State New, archived
Headers show
Series cifs: double lock in cifs_reconnect_tcon() | expand

Commit Message

Dan Carpenter April 6, 2023, 8:55 a.m. UTC
This lock was supposed to be an unlock.

Fixes: 6cc041e90c17 ("cifs: avoid races in parallel reconnects in smb1")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 fs/cifs/cifssmb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paulo Alcantara April 6, 2023, 12:09 p.m. UTC | #1
Dan Carpenter <error27@gmail.com> writes:

> This lock was supposed to be an unlock.
>
> Fixes: 6cc041e90c17 ("cifs: avoid races in parallel reconnects in smb1")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
>  fs/cifs/cifssmb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Steve French April 6, 2023, 11:43 p.m. UTC | #2
Added to cifs-2.6.git for-next

On Thu, Apr 6, 2023 at 7:10 AM Paulo Alcantara <pc@manguebit.com> wrote:
>
> Dan Carpenter <error27@gmail.com> writes:
>
> > This lock was supposed to be an unlock.
> >
> > Fixes: 6cc041e90c17 ("cifs: avoid races in parallel reconnects in smb1")
> > Signed-off-by: Dan Carpenter <error27@gmail.com>
> > ---
> >  fs/cifs/cifssmb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
diff mbox series

Patch

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 0d30b17494e4..9d963caec35c 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -120,7 +120,7 @@  cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
 	spin_lock(&server->srv_lock);
 	if (server->tcpStatus == CifsNeedReconnect) {
 		spin_unlock(&server->srv_lock);
-		mutex_lock(&ses->session_mutex);
+		mutex_unlock(&ses->session_mutex);
 
 		if (tcon->retry)
 			goto again;