Skip to contentSkip to conversation

cifs: fix wrong unlock before return from cifs_tree_connect()

PATCH Applied Yang Yingliang 3 participants 3 messages Jul 29, 2022 – Aug 1, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: fix wrong unlock before return from cifs_tree_connect()

It should unlock 'tcon->tc_lock' before return from cifs_tree_connect().

Fixes fe67bd563ec2 ("cifs: avoid use of global locks for high contention data")
---
 fs/cifs/connect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/connect.c +1 -1
index 931d4b6fafc8..1362210f3ece 100644
@@ -4583,7 +4583,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
 	if (tcon->ses->ses_status != SES_GOOD ||
 	    (tcon->status != TID_NEW &&
 	    tcon->status != TID_NEED_TCON)) {
-		spin_unlock(&tcon->ses->ses_lock);
+		spin_unlock(&tcon->tc_lock);
 		return 0;
 	}
 	tcon->status = TID_IN_TCON;
Signature · 1 line
2.25.1
Applied
#1 lore raw

merged into cifs-2.6.git for-next

Quoted 25 lines · Yang Yingliang

It should unlock 'tcon->tc_lock' before return from cifs_tree_connect().

Fixes fe67bd563ec2 ("cifs: avoid use of global locks for high contention data")
---
 fs/cifs/connect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/connect.c +1 -2
index 931d4b6fafc8..1362210f3ece 100644
@@ -4583,7 +4583,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
        if (tcon->ses->ses_status != SES_GOOD ||
            (tcon->status != TID_NEW &&
            tcon->status != TID_NEED_TCON)) {
-               spin_unlock(&tcon->ses->ses_lock);
+               spin_unlock(&tcon->tc_lock);
                return 0;
        }
        tcon->status = TID_IN_TCON;
--

2.25.1

Signature · 3 lines
Thanks,

Steve
#2 lore raw
Quoted 34 lines · Steve French

merged into cifs-2.6.git for-next

Quoted 23 lines · Yang Yingliang

It should unlock 'tcon->tc_lock' before return from cifs_tree_connect().

Fixes fe67bd563ec2 ("cifs: avoid use of global locks for high contention data")
---
 fs/cifs/connect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/connect.c +1 -2
index 931d4b6fafc8..1362210f3ece 100644
@@ -4583,7 +4583,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
        if (tcon->ses->ses_status != SES_GOOD ||
            (tcon->status != TID_NEW &&
            tcon->status != TID_NEED_TCON)) {
-               spin_unlock(&tcon->ses->ses_lock);
+               spin_unlock(&tcon->tc_lock);
                return 0;
        }
        tcon->status = TID_IN_TCON;
--
Quoted 2 lines

2.25.1

--
Thanks,

Quoted 1 line

Steve

Good catch. Looks good to me.

Signature · 2 lines
Regards,
Shyam