Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
cifs: log session id when a matching ses is not found
Browse files Browse the repository at this point in the history
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.

This change also changes this log to FYI, since it is normal to
see then during a reconnect. Doing the same for a similar log
in case of signed connections.

The plan is to have a tracepoint for this event, so that we will
be able to see this event if need be. That will be done as
another change.

Signed-off-by: Shyam Prasad N <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
sprasad-microsoft authored and Steve French committed Jun 29, 2023
1 parent 5f2a0af commit ac615db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fs/smb/client/smb2ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -4444,8 +4444,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(FYI, "%s: Could not get %scryption key. sid: 0x%llx\n", __func__,
enc ? "en" : "de", le64_to_cpu(tr_hdr->SessionId));
return rc;
}

Expand Down
4 changes: 2 additions & 2 deletions fs/smb/client/smb2transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int smb2_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key)
if (ses->Suid == ses_id)
goto found;
}
cifs_server_dbg(VFS, "%s: Could not find session 0x%llx\n",
cifs_server_dbg(FYI, "%s: Could not find session 0x%llx\n",
__func__, ses_id);
rc = -ENOENT;
goto out;
Expand Down Expand Up @@ -564,7 +564,7 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server,

rc = smb2_get_sign_key(le64_to_cpu(shdr->SessionId), server, key);
if (unlikely(rc)) {
cifs_server_dbg(VFS, "%s: Could not get signing key\n", __func__);
cifs_server_dbg(FYI, "%s: Could not get signing key\n", __func__);
return rc;
}

Expand Down

0 comments on commit ac615db

Please sign in to comment.