From patchwork Wed May 18 21:33:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12854162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 785D0C433EF for ; Wed, 18 May 2022 21:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243187AbiERVeA (ORCPT ); Wed, 18 May 2022 17:34:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243183AbiERVd7 (ORCPT ); Wed, 18 May 2022 17:33:59 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC2342370E7 for ; Wed, 18 May 2022 14:33:57 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id m6so4068358ljb.2 for ; Wed, 18 May 2022 14:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=r7XZvQpgnTuiTga7VpVbKSJYtKZ/LYSvfLiOxLtdm1k=; b=MYgqdnQRzPk5qkZ5sZLhfY2orqlO+GDj5TiPzw1GH+XWQYF6qHhwZ//ODjXp5N07lh Lv3anL1YxUeG5TRQ/UbxjOeDt/B4h+XAjc8PFFUraI1zu8A2qURFSs7tZkgoMFZdMxsF y1D0UBGCWE8X7ge5AWNVfghnjy1XmyaRFFVrGBH0x51CMSPtK8gsKqvauUYKNQt8g2vc /emtyhaQntiVvNgB+8zrEWm2XtBjRmbrvuDgF0KdXYrh2UstLShH5eUNM5nCwItpV7uK fDBXqqJ3I46CRUUt4PpBQt+aG9y+JygssJrGz52Rnx/jDowVSC/JSoBEXuIm8fc+u8bZ d8Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=r7XZvQpgnTuiTga7VpVbKSJYtKZ/LYSvfLiOxLtdm1k=; b=MgwBYx2uuoib7PwhqDc4gDM1kxKSg8GdlfVGVgk3HQ5WNSO/Oo0uahW7aGINlP6ngw 5YXIhCPjH3YNSY+fhcruPCkyVIZnqVM+5LApRY4KWRnTQ64yki/Ns0zFmjvnu3djsZ3J DY6C8yNgm87cRnQzfDWz4IDszMXZeMdkbkPDktw+Z0jYffQj8bjCxAYE1UyXc9crsceR CZRWXpokk0lymy5vCeWGrqTM2UFiQ9jsAOZbaYGzTJpM+BEDuirypvX7GC71Kigi9MzB 5Mn3EX6o27xsQYNFq99roA0/Naal/xHEvKGaxay4g6PdtST7NXtEcH6uLavAC0ct2Jwz JXEA== X-Gm-Message-State: AOAM5335rgjeq7mdLAdicytqmQi742uQwss3Elv8eriq/U9wvdPT2Cj6 AxcH6KUS60gMW0h34V5zgozNvN0MlGvPriNaj/rxyspG X-Google-Smtp-Source: ABdhPJxoBvWmOW+4GyBP4+nn6k+nfkDr4aJCBKLKRzriTwQmPZvZ1npdY/6QYfErhhZnqCuNhi1BXT+yg7/xf6Q2paQ= X-Received: by 2002:a2e:7f08:0:b0:253:c7e7:f571 with SMTP id a8-20020a2e7f08000000b00253c7e7f571mr787565ljd.398.1652909635796; Wed, 18 May 2022 14:33:55 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Wed, 18 May 2022 16:33:44 -0500 Message-ID: Subject: [PATCH][SMB3] add dynamic trace point for debugging lease break not found To: CIFS Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Looks like we don't have a dynamic trace point to catch the case where the server sends a lease break we don't recognize. Attached is a WIP patch for doing this. Thoughts? diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index 3fe47a88f47d..6f049da5a8c1 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -656,6 +656,9 @@ 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; } diff --git a/fs/cifs/trace.h b/fs/cifs/trace.h index bc279616c513..09d3dfed86d9 100644 --- a/fs/cifs/trace.h +++ b/fs/cifs/trace.h @@ -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,