Skip to content

Commit 61986a5

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: new dynamic tracepoint to track ses not found errors
It is perfectly valid to not find session not found errors when a reconnect of a session happens when requests for the same session are happening in parallel. We had these log messages as VFS logs. My last change dumped these logs as FYI logs. This change just creates a new dynamic tracepoint to capture events of this type, just in case it is useful while debugging issues in the future. Signed-off-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent ac615db commit 61986a5

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

fs/smb/client/smb2ops.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,6 +4414,8 @@ smb2_get_enc_key(struct TCP_Server_Info *server, __u64 ses_id, int enc, u8 *key)
44144414
}
44154415
spin_unlock(&cifs_tcp_ses_lock);
44164416

4417+
trace_smb3_ses_not_found(ses_id);
4418+
44174419
return -EAGAIN;
44184420
}
44194421
/*

fs/smb/client/smb2transport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ int smb2_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key)
9292
if (ses->Suid == ses_id)
9393
goto found;
9494
}
95+
trace_smb3_ses_not_found(ses_id);
9596
cifs_server_dbg(FYI, "%s: Could not find session 0x%llx\n",
9697
__func__, ses_id);
9798
rc = -ENOENT;

fs/smb/client/trace.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,26 @@ DEFINE_EVENT(smb3_reconnect_class, smb3_##name, \
10031003
DEFINE_SMB3_RECONNECT_EVENT(reconnect);
10041004
DEFINE_SMB3_RECONNECT_EVENT(partial_send_reconnect);
10051005

1006+
DECLARE_EVENT_CLASS(smb3_ses_class,
1007+
TP_PROTO(__u64 sesid),
1008+
TP_ARGS(sesid),
1009+
TP_STRUCT__entry(
1010+
__field(__u64, sesid)
1011+
),
1012+
TP_fast_assign(
1013+
__entry->sesid = sesid;
1014+
),
1015+
TP_printk("sid=0x%llx",
1016+
__entry->sesid)
1017+
)
1018+
1019+
#define DEFINE_SMB3_SES_EVENT(name) \
1020+
DEFINE_EVENT(smb3_ses_class, smb3_##name, \
1021+
TP_PROTO(__u64 sesid), \
1022+
TP_ARGS(sesid))
1023+
1024+
DEFINE_SMB3_SES_EVENT(ses_not_found);
1025+
10061026
DECLARE_EVENT_CLASS(smb3_credit_class,
10071027
TP_PROTO(__u64 currmid,
10081028
__u64 conn_id,

0 commit comments

Comments
 (0)