From patchwork Sun May 22 05:46:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12858099 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 41BCFC433EF for ; Sun, 22 May 2022 05:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbiEVFrQ (ORCPT ); Sun, 22 May 2022 01:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238064AbiEVFrP (ORCPT ); Sun, 22 May 2022 01:47:15 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B90B3AA79 for ; Sat, 21 May 2022 22:47:12 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id p4so19149094lfg.4 for ; Sat, 21 May 2022 22:47:12 -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=uyjYxEVvx39n6G7aDyqQEIHvxLR3HMfTdiZTXIr8Aiw=; b=DbTf5TcMiNLtCuMFizUilEe0gxfGpU/9lc8Je8MbXXLKO4Nq4Np3RE04v0yhI1tbXj 5ZeNLPVVt3cs4Sz1SuXgq0WgXOD8GlYsBgzn38Sr4ayWzyoA/mvd0Tf9tJ/A2BkSDKrT TYl9rPQnpaOMUo/oBVIVhbh/krarU4QINyQgRsFuNFkiGkoYBOdaV93gQRxYQ5vzp9Sq ywQfoos5IbMS7VzcpnIfp9q7huqrWaOY9AQL5XIHTtmMKDOCR8OCEHx+R4yQAZH0hoNT YXR6EgvqLr83pKE1KPhVe1xzD2WoTPICad4bmVnwDjea7AmpUT/tmARhmJO3h91Blmkn DEng== 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=uyjYxEVvx39n6G7aDyqQEIHvxLR3HMfTdiZTXIr8Aiw=; b=DpXFQH4ihxTrdFOgyaBrTV9b55oDTY2FEtrFumqPrje9yOobS0GaWNj62kykPS/xO8 WXFE5+YxXh6Bv+nJGRiRNp1NW6t+8AbRGVjRUv1VVXa9qhgjukobNjr39ZXjEcLRESc8 AVmeoqOBtFWR5mzvar8lWUf+7V5OBcUXuCrhotf62kzjv0zKe0mUHs25m9J4T6bmwkN2 3kGgIeAnsWhIXUnBe8B0OdVXY8T9xVb6FB9geDT512zCqlX9ud8eNV7ifUFTopmqfbwp u1tEpqeZG5kJyNMoAtRRM4zTHSPl0fYU0eb3l7SVFFWNKtXOHQqRUd2Nnsvro8h4ErTC 22NA== X-Gm-Message-State: AOAM5326Q7FhzdadYAh7RGTJjJ5qWfODoXXRb5TxwJJfLLGpnnnsPhSd z29gxMdQ4HSE83CKA0QLP1TZG7339nth6QF0FOy+T0X1sTU= X-Google-Smtp-Source: ABdhPJx2/mLCanAl7vWgGdHXZlXVOdUfPzK1Oc+Gq8Ey8afzrFb9jStVYNWSRNm9RRq7tmCm+NYiVfJHvwndJ7rqoHA= X-Received: by 2002:a05:6512:1583:b0:477:cc34:4a6c with SMTP id bp3-20020a056512158300b00477cc344a6cmr9980868lfb.595.1653198430052; Sat, 21 May 2022 22:47:10 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Sun, 22 May 2022 00:46:58 -0500 Message-ID: Subject: [PATCH][SMB2] Add tracepoint for oplock break file not found To: CIFS Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Similar to the earlier patch I sent out for lease not found, this patch handles the oplock case In order to debug problems with server potentially sending us an oplock that we don't recognize (or a race with close and oplock break) it would be helpful to have a dynamic trace point for this case. New tracepoint called trace_smb3_oplock_not_found From b231c5f68b9fda44602cd8e266db6f4eb8f6d8a7 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 22 May 2022 00:41:41 -0500 Subject: [PATCH] smb3: add trace point for oplock not found In order to debug problems with server potentially sending us an oplock that we don't recognize (or a race with close and oplock break) it would be helpful to have a dynamic trace point for this case. New tracepoint is called trace_smb3_oplock_not_found Signed-off-by: Steve French --- fs/cifs/smb2misc.c | 4 ++++ fs/cifs/trace.h | 1 + 2 files changed, 5 insertions(+) diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index f236beaff96d..17813c3d0c6e 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -732,6 +732,10 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) } spin_unlock(&cifs_tcp_ses_lock); cifs_dbg(FYI, "No file id matched, oplock break ignored\n"); + trace_smb3_oplock_not_found(0 /* no xid */, rsp->PersistentFid, + le32_to_cpu(rsp->hdr.Id.SyncId.TreeId), + le64_to_cpu(rsp->hdr.SessionId)); + return true; } diff --git a/fs/cifs/trace.h b/fs/cifs/trace.h index 09d3dfed86d9..2be5e0c8564d 100644 --- a/fs/cifs/trace.h +++ b/fs/cifs/trace.h @@ -158,6 +158,7 @@ DEFINE_SMB3_FD_EVENT(flush_enter); DEFINE_SMB3_FD_EVENT(flush_done); DEFINE_SMB3_FD_EVENT(close_enter); DEFINE_SMB3_FD_EVENT(close_done); +DEFINE_SMB3_FD_EVENT(oplock_not_found); DECLARE_EVENT_CLASS(smb3_fd_err_class, TP_PROTO(unsigned int xid, -- 2.34.1