[1/2] cifs: Don't match port on SMBDirect transport
diff mbox series

Message ID 1557954545-17831-1-git-send-email-longli@linuxonhyperv.com
State New
Headers show
Series
  • [1/2] cifs: Don't match port on SMBDirect transport
Related show

Commit Message

Long Li May 15, 2019, 9:09 p.m. UTC
From: Long Li <longli@microsoft.com>

SMBDirect manages its own ports in the transport layer, there is no need to
check the port to find a connection.

Signed-off-by: Long Li <longli@microsoft.com>
---
 fs/cifs/connect.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Steve French May 16, 2019, 3 a.m. UTC | #1
merged into cifs-2.6.git for-next

On Wed, May 15, 2019 at 4:09 PM <longli@linuxonhyperv.com> wrote:
>
> From: Long Li <longli@microsoft.com>
>
> SMBDirect manages its own ports in the transport layer, there is no need to
> check the port to find a connection.
>
> Signed-off-by: Long Li <longli@microsoft.com>
> ---
>  fs/cifs/connect.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 0b3ac8b76d18..8c4121da624e 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -2446,6 +2446,10 @@ match_port(struct TCP_Server_Info *server, struct sockaddr *addr)
>  {
>         __be16 port, *sport;
>
> +       /* SMBDirect manages its own ports, don't match it here */
> +       if (server->rdma)
> +               return true;
> +
>         switch (addr->sa_family) {
>         case AF_INET:
>                 sport = &((struct sockaddr_in *) &server->dstaddr)->sin_port;
> --
> 2.17.1
>

Patch
diff mbox series

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 0b3ac8b76d18..8c4121da624e 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2446,6 +2446,10 @@  match_port(struct TCP_Server_Info *server, struct sockaddr *addr)
 {
 	__be16 port, *sport;
 
+	/* SMBDirect manages its own ports, don't match it here */
+	if (server->rdma)
+		return true;
+
 	switch (addr->sa_family) {
 	case AF_INET:
 		sport = &((struct sockaddr_in *) &server->dstaddr)->sin_port;