diff mbox series

[02/14] cifs: add xid to query server interface call

Message ID 20231030110020.45627-2-sprasad@microsoft.com
State New
Headers show
Series [01/14] cifs: print server capabilities in DebugData | expand

Commit Message

Shyam Prasad N Oct. 30, 2023, 11 a.m. UTC
From: Shyam Prasad N <sprasad@microsoft.com>

We were passing 0 as the xid for the call to query
server interfaces. This is not great for debugging.
This change adds a real xid.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
---
 fs/smb/client/connect.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Bharath SM Oct. 31, 2023, 5:35 a.m. UTC | #1
Looks good to me.

On Mon, Oct 30, 2023 at 4:30 PM <nspmangalore@gmail.com> wrote:
>
> From: Shyam Prasad N <sprasad@microsoft.com>
>
> We were passing 0 as the xid for the call to query
> server interfaces. This is not great for debugging.
> This change adds a real xid.
>
> Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
> ---
>  fs/smb/client/connect.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
> index 7b923e36501b..15a1c86482ed 100644
> --- a/fs/smb/client/connect.c
> +++ b/fs/smb/client/connect.c
> @@ -119,6 +119,7 @@ static int reconn_set_ipaddr_from_hostname(struct TCP_Server_Info *server)
>  static void smb2_query_server_interfaces(struct work_struct *work)
>  {
>         int rc;
> +       int xid;
>         struct cifs_tcon *tcon = container_of(work,
>                                         struct cifs_tcon,
>                                         query_interfaces.work);
> @@ -126,7 +127,10 @@ static void smb2_query_server_interfaces(struct work_struct *work)
>         /*
>          * query server network interfaces, in case they change
>          */
> -       rc = SMB3_request_interfaces(0, tcon, false);
> +       xid = get_xid();
> +       rc = SMB3_request_interfaces(xid, tcon, false);
> +       free_xid(xid);
> +
>         if (rc) {
>                 cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n",
>                                 __func__, rc);
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 7b923e36501b..15a1c86482ed 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -119,6 +119,7 @@  static int reconn_set_ipaddr_from_hostname(struct TCP_Server_Info *server)
 static void smb2_query_server_interfaces(struct work_struct *work)
 {
 	int rc;
+	int xid;
 	struct cifs_tcon *tcon = container_of(work,
 					struct cifs_tcon,
 					query_interfaces.work);
@@ -126,7 +127,10 @@  static void smb2_query_server_interfaces(struct work_struct *work)
 	/*
 	 * query server network interfaces, in case they change
 	 */
-	rc = SMB3_request_interfaces(0, tcon, false);
+	xid = get_xid();
+	rc = SMB3_request_interfaces(xid, tcon, false);
+	free_xid(xid);
+
 	if (rc) {
 		cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n",
 				__func__, rc);