Skip to content

Commit 9599d59

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: do not pass cifs_sb when trying to add channels
The only reason why cifs_sb gets passed today to cifs_try_adding_channels is to pass the local_nls field for the new channels and binding session. However, the ses struct already has local_nls field that is setup during the first cifs_setup_session. So there is no need to pass cifs_sb. This change removes cifs_sb from the arg list for this and the functions that it calls and uses ses->local_nls instead. Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent fa1d050 commit 9599d59

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

fs/smb/client/cifsproto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ void cifs_free_hash(struct shash_desc **sdesc);
610610

611611
struct cifs_chan *
612612
cifs_ses_find_chan(struct cifs_ses *ses, struct TCP_Server_Info *server);
613-
int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses);
613+
int cifs_try_adding_channels(struct cifs_ses *ses);
614614
bool is_server_using_iface(struct TCP_Server_Info *server,
615615
struct cifs_server_iface *iface);
616616
bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface);

fs/smb/client/connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3564,7 +3564,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
35643564
ctx->prepath = NULL;
35653565

35663566
out:
3567-
cifs_try_adding_channels(cifs_sb, mnt_ctx.ses);
3567+
cifs_try_adding_channels(mnt_ctx.ses);
35683568
rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon);
35693569
if (rc)
35703570
goto error;

fs/smb/client/sess.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "fs_context.h"
2525

2626
static int
27-
cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
27+
cifs_ses_add_channel(struct cifs_ses *ses,
2828
struct cifs_server_iface *iface);
2929

3030
bool
@@ -172,7 +172,7 @@ cifs_chan_is_iface_active(struct cifs_ses *ses,
172172
}
173173

174174
/* returns number of channels added */
175-
int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
175+
int cifs_try_adding_channels(struct cifs_ses *ses)
176176
{
177177
struct TCP_Server_Info *server = ses->server;
178178
int old_chan_count, new_chan_count;
@@ -255,7 +255,7 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
255255
kref_get(&iface->refcount);
256256

257257
spin_unlock(&ses->iface_lock);
258-
rc = cifs_ses_add_channel(cifs_sb, ses, iface);
258+
rc = cifs_ses_add_channel(ses, iface);
259259
spin_lock(&ses->iface_lock);
260260

261261
if (rc) {
@@ -458,7 +458,7 @@ cifs_ses_find_chan(struct cifs_ses *ses, struct TCP_Server_Info *server)
458458
}
459459

460460
static int
461-
cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
461+
cifs_ses_add_channel(struct cifs_ses *ses,
462462
struct cifs_server_iface *iface)
463463
{
464464
struct TCP_Server_Info *chan_server;
@@ -537,7 +537,7 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
537537
* This will be used for encoding/decoding user/domain/pw
538538
* during sess setup auth.
539539
*/
540-
ctx->local_nls = cifs_sb->local_nls;
540+
ctx->local_nls = ses->local_nls;
541541

542542
/* Use RDMA if possible */
543543
ctx->rdma = iface->rdma_capable;
@@ -583,7 +583,7 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
583583

584584
rc = cifs_negotiate_protocol(xid, ses, chan->server);
585585
if (!rc)
586-
rc = cifs_setup_session(xid, ses, chan->server, cifs_sb->local_nls);
586+
rc = cifs_setup_session(xid, ses, chan->server, ses->local_nls);
587587

588588
mutex_unlock(&ses->session_mutex);
589589

0 commit comments

Comments
 (0)