smb3: add trace point for lease not found issue
authorSteve French <stfrench@microsoft.com>
Sun, 22 May 2022 04:56:16 +0000 (23:56 -0500)
committerSteve French <stfrench@microsoft.com>
Sun, 22 May 2022 04:56:16 +0000 (23:56 -0500)
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 <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2misc.c
fs/cifs/trace.h

index 15b5d2565e79887da44c21c1ba944a111ee9267f..f236beaff96d6e32134321ef3190e79b2824c092 100644 (file)
@@ -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;
 }
 
index bc279616c513a86f14c002b9b29c9e34069820b9..09d3dfed86d98454d720491c291e1bcf7a8a34d1 100644 (file)
@@ -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,