Skip to content

Commit c9f1c19

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: nosharesock should not share socket with future sessions
Today, when a new mount is done with nosharesock, we ensure that we don't select an existing matching session. However, we don't mark the connection as nosharesock, which means that those could be shared with future sessions. Fixed it with this commit. Also printing this info in DebugData. Signed-off-by: Shyam Prasad N <[email protected]> Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent b5013d0 commit c9f1c19

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

fs/cifs/cifs_debug.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,8 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
358358
seq_printf(m, " signed");
359359
if (server->posix_ext_supported)
360360
seq_printf(m, " posix");
361+
if (server->nosharesock)
362+
seq_printf(m, " nosharesock");
361363

362364
if (server->rdma)
363365
seq_printf(m, "\nRDMA ");

fs/cifs/cifsglob.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ struct TCP_Server_Info {
592592
struct list_head pending_mid_q;
593593
bool noblocksnd; /* use blocking sendmsg */
594594
bool noautotune; /* do not autotune send buf sizes */
595+
bool nosharesock;
595596
bool tcp_nodelay;
596597
unsigned int credits; /* send no more requests at once */
597598
unsigned int max_credits; /* can override large 32000 default at mnt */

fs/cifs/connect.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,13 @@ static int match_server(struct TCP_Server_Info *server, struct smb3_fs_context *
12171217
{
12181218
struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr;
12191219

1220-
if (ctx->nosharesock)
1220+
if (ctx->nosharesock) {
1221+
server->nosharesock = true;
1222+
return 0;
1223+
}
1224+
1225+
/* this server does not share socket */
1226+
if (server->nosharesock)
12211227
return 0;
12221228

12231229
/* If multidialect negotiation see if existing sessions match one */

0 commit comments

Comments
 (0)