]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
cifs: protect session channel fields with chan_lock
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 19 Jul 2021 10:54:46 +0000 (10:54 +0000)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 9 Mar 2022 14:17:50 +0000 (15:17 +0100)
commit3b02aee76091d68a24f51404f01eb7d39ad6c7dd
treea4a831fe35062719fa9e1f3b69c7fe7339355900
parent27ea7336bd7c14e12de24a9b2adbfa7d0aa06412
cifs: protect session channel fields with chan_lock

BugLink: https://bugs.launchpad.net/bugs/1964361
[ Upstream commit 724244cdb3828522109c88e56a0242537aefabe9 ]

Introducing a new spin lock to protect all the channel related
fields in a cifs_ses struct. This lock should be taken
whenever dealing with the channel fields, and should be held
only for very short intervals which will not sleep.

Currently, all channel related fields in cifs_ses structure
are protected by session_mutex. However, this mutex is held for
long periods (sometimes while waiting for a reply from server).
This makes the codepath quite tricky to change.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/cifs/cifs_debug.c
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/misc.c
fs/cifs/sess.c
fs/cifs/transport.c