Skip to content

Commit

Permalink
smb3: add trace point for lease not found issue
Browse files Browse the repository at this point in the history
When trying to debug problems with server sending us a
lease we don't recognize, it would be helpful to have
a dynamic trace point for this case.  New tracepoint
is called trace_smb3_lease_not_found

Acked-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
Steve French committed May 22, 2022
1 parent fb64f7f commit fb253d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/cifs/smb2misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,12 @@ smb2_is_valid_lease_break(char *buffer)
}
spin_unlock(&cifs_tcp_ses_lock);
cifs_dbg(FYI, "Can not process lease break - no lease matched\n");
trace_smb3_lease_not_found(le32_to_cpu(rsp->CurrentLeaseState),
le32_to_cpu(rsp->hdr.Id.SyncId.TreeId),
le64_to_cpu(rsp->hdr.SessionId),
*((u64 *)rsp->LeaseKey),
*((u64 *)&rsp->LeaseKey[8]));

return false;
}

Expand Down
1 change: 1 addition & 0 deletions fs/cifs/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ DEFINE_EVENT(smb3_lease_done_class, smb3_##name, \
TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high))

DEFINE_SMB3_LEASE_DONE_EVENT(lease_done);
DEFINE_SMB3_LEASE_DONE_EVENT(lease_not_found);

DECLARE_EVENT_CLASS(smb3_lease_err_class,
TP_PROTO(__u32 lease_state,
Expand Down

0 comments on commit fb253d5

Please sign in to comment.