]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cifs: serialize other channels when query server interfaces is pending
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 2 Jun 2025 17:07:15 +0000 (22:37 +0530)
committerSteve French <stfrench@microsoft.com>
Tue, 3 Jun 2025 23:42:47 +0000 (18:42 -0500)
commitb5e3e6e28cf3853566ba5d816f79aba5be579158
tree1b213e54705e1b02799b5f8470d5a4a781d376fc
parent66d590b828b1fd9fa337047ae58fe1c4c6f43609
cifs: serialize other channels when query server interfaces is pending

Today, during smb2_reconnect, session_mutex is released as soon as
the tcon is reconnected and is in a good state. However, in case
multichannel is enabled, there is also a query of server interfaces that
follows. We've seen that this query can race with reconnects of other
channels, causing them to step on each other with reconnects.

This change extends the hold of session_mutex till after the query of
server interfaces is complete. In order to avoid recursive smb2_reconnect
checks during query ioctl, this change also introduces a session flag
for sessions where such a query is in progress.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsglob.h
fs/smb/client/smb2pdu.c