diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2022-04-08 15:31:37 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-05-24 21:16:32 +0200 |
commit | 5752bf645f9dd7db600651f726eb04a97c9f597f (patch) | |
tree | f486c71eb05d7e37800e182d49325838ac0c2af3 /fs/cifs/sess.c | |
parent | cifs: use new enum for ses_status (diff) | |
download | linux-5752bf645f9dd7db600651f726eb04a97c9f597f.tar.xz linux-5752bf645f9dd7db600651f726eb04a97c9f597f.zip |
cifs: avoid parallel session setups on same channel
After allowing channels to reconnect in parallel, it now
becomes important to take care that multiple processes do not
call negotiate/session setup in parallel on the same channel.
This change avoids that by marking a channel as "in_reconnect".
During session setup if the channel in question has this flag
set, we return immediately.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r-- | fs/cifs/sess.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 32f478c7a66d..7c453f8701eb 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -86,6 +86,33 @@ cifs_ses_get_chan_index(struct cifs_ses *ses, } void +cifs_chan_set_in_reconnect(struct cifs_ses *ses, + struct TCP_Server_Info *server) +{ + unsigned int chan_index = cifs_ses_get_chan_index(ses, server); + + ses->chans[chan_index].in_reconnect = true; +} + +void +cifs_chan_clear_in_reconnect(struct cifs_ses *ses, + struct TCP_Server_Info *server) +{ + unsigned int chan_index = cifs_ses_get_chan_index(ses, server); + + ses->chans[chan_index].in_reconnect = false; +} + +bool +cifs_chan_in_reconnect(struct cifs_ses *ses, + struct TCP_Server_Info *server) +{ + unsigned int chan_index = cifs_ses_get_chan_index(ses, server); + + return CIFS_CHAN_IN_RECONNECT(ses, chan_index); +} + +void cifs_chan_set_need_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) { |