Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.com>
To: Shyam Prasad N <nspmangalore@gmail.com>,
	linux-cifs@vger.kernel.org, smfrench@gmail.com, pc@cjr.nz,
	ematsumiya@suse.de, bharathsm.hsk@gmail.com
Cc: Shyam Prasad N <sprasad@microsoft.com>
Subject: Re: [PATCH 1/3] cifs: log session id when a matching ses is not found
Date: Thu, 22 Jun 2023 15:45:06 -0300	[thread overview]
Message-ID: <e2e6207f531cee699b0bd9b261fb6232.pc@manguebit.com> (raw)
In-Reply-To: <20230622181604.4788-1-sprasad@microsoft.com>

Shyam Prasad N <nspmangalore@gmail.com> writes:

> We do not log the session id in crypt_setup when a matching
> session is not found. Printing the session id helps debugging
> here. This change does just that.
>
> Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
> ---
>  fs/smb/client/smb2ops.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
> index a8bb9d00d33a..8e4900f6cd53 100644
> --- a/fs/smb/client/smb2ops.c
> +++ b/fs/smb/client/smb2ops.c
> @@ -4439,8 +4439,8 @@ crypt_message(struct TCP_Server_Info *server, int num_rqst,
>  
>  	rc = smb2_get_enc_key(server, le64_to_cpu(tr_hdr->SessionId), enc, key);
>  	if (rc) {
> -		cifs_server_dbg(VFS, "%s: Could not get %scryption key\n", __func__,
> -			 enc ? "en" : "de");
> +		cifs_server_dbg(VFS, "%s: Could not get %scryption key. sid: 0x%llx\n", __func__,
> +			 enc ? "en" : "de", le64_to_cpu(tr_hdr->SessionId));

I think this should be FYI rather than VFS as it is usually fine to fail
on smb2_get_enc_key() while the session was reconnected, since the I/O
would be retried later and the current value of @tr_hdr->SessionId would
no longer match any existing session ids.  I have seen such messages
while running reconnect tests with 'seal' mount option.

Other than that, looks good.

  parent reply	other threads:[~2023-06-22 18:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 18:16 [PATCH 1/3] cifs: log session id when a matching ses is not found Shyam Prasad N
2023-06-22 18:16 ` [PATCH 2/3] cifs: prevent use-after-free by freeing the cfile later Shyam Prasad N
2023-06-22 18:46   ` Paulo Alcantara
2023-06-22 19:13     ` Steve French
2023-06-22 18:16 ` [PATCH 3/3] cifs: do all necessary checks for credits within or before locking Shyam Prasad N
2023-06-22 18:45 ` Paulo Alcantara [this message]
2023-06-23  4:16   ` [PATCH 1/3] cifs: log session id when a matching ses is not found Shyam Prasad N

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e2e6207f531cee699b0bd9b261fb6232.pc@manguebit.com \
    --to=pc@manguebit.com \
    --cc=bharathsm.hsk@gmail.com \
    --cc=ematsumiya@suse.de \
    --cc=linux-cifs@vger.kernel.org \
    --cc=nspmangalore@gmail.com \
    --cc=pc@cjr.nz \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox