Skip to content

Commit e19d8dd

Browse files
Wang Zhaolongsmfrench
authored andcommitted
smb: client: remove redundant lstrp update in negotiate protocol
Commit 34331d7 ("smb: client: fix first command failure during re-negotiation") addressed a race condition by updating lstrp before entering negotiate state. However, this approach may have some unintended side effects. The lstrp field is documented as "when we got last response from this server", and updating it before actually receiving a server response could potentially affect other mechanisms that rely on this timestamp. For example, the SMB echo detection logic also uses lstrp as a reference point. In scenarios with frequent user operations during reconnect states, the repeated calls to cifs_negotiate_protocol() might continuously update lstrp, which could interfere with the echo detection timing. Additionally, commit 266b5d0 ("smb: client: fix race condition in negotiate timeout by using more precise timing") introduced a dedicated neg_start field specifically for tracking negotiate start time. This provides a more precise solution for the original race condition while preserving the intended semantics of lstrp. Since the race condition is now properly handled by the neg_start mechanism, the lstrp update in cifs_negotiate_protocol() is no longer necessary and can be safely removed. Fixes: 266b5d0 ("smb: client: fix race condition in negotiate timeout by using more precise timing") Cc: [email protected] Acked-by: Paulo Alcantara (Red Hat) <[email protected]> Signed-off-by: Wang Zhaolong <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent e3f776d commit e19d8dd

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

fs/smb/client/connect.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4205,7 +4205,6 @@ cifs_negotiate_protocol(const unsigned int xid, struct cifs_ses *ses,
42054205
return 0;
42064206
}
42074207

4208-
server->lstrp = jiffies;
42094208
server->tcpStatus = CifsInNegotiate;
42104209
server->neg_start = jiffies;
42114210
spin_unlock(&server->srv_lock);

0 commit comments

Comments
 (0)