Commit c9f1c19c authored by Shyam Prasad N's avatar Shyam Prasad N Committed by Steve French
Browse files

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: default avatarShyam Prasad N <sprasad@microsoft.com>
Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent b5013d08
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -358,6 +358,8 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
			seq_printf(m, " signed");
			seq_printf(m, " signed");
		if (server->posix_ext_supported)
		if (server->posix_ext_supported)
			seq_printf(m, " posix");
			seq_printf(m, " posix");
		if (server->nosharesock)
			seq_printf(m, " nosharesock");


		if (server->rdma)
		if (server->rdma)
			seq_printf(m, "\nRDMA ");
			seq_printf(m, "\nRDMA ");
+1 −0
Original line number Original line Diff line number Diff line
@@ -592,6 +592,7 @@ struct TCP_Server_Info {
	struct list_head pending_mid_q;
	struct list_head pending_mid_q;
	bool noblocksnd;		/* use blocking sendmsg */
	bool noblocksnd;		/* use blocking sendmsg */
	bool noautotune;		/* do not autotune send buf sizes */
	bool noautotune;		/* do not autotune send buf sizes */
	bool nosharesock;
	bool tcp_nodelay;
	bool tcp_nodelay;
	unsigned int credits;  /* send no more requests at once */
	unsigned int credits;  /* send no more requests at once */
	unsigned int max_credits; /* can override large 32000 default at mnt */
	unsigned int max_credits; /* can override large 32000 default at mnt */
+7 −1
Original line number Original line Diff line number Diff line
@@ -1217,7 +1217,13 @@ static int match_server(struct TCP_Server_Info *server, struct smb3_fs_context *
{
{
	struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr;
	struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr;


	if (ctx->nosharesock)
	if (ctx->nosharesock) {
		server->nosharesock = true;
		return 0;
	}

	/* this server does not share socket */
	if (server->nosharesock)
		return 0;
		return 0;


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