Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3756129rwb; Sat, 12 Nov 2022 12:08:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf5QH6AXuwA+sWBOrWSlBR3AxKwpObc3UPodafdWXsSTChMk2tfIKJMdRELS9x3HbKyKtE0V X-Received: by 2002:a17:90a:c087:b0:212:cd9c:b44f with SMTP id o7-20020a17090ac08700b00212cd9cb44fmr7446725pjs.14.1668283697375; Sat, 12 Nov 2022 12:08:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668283697; cv=none; d=google.com; s=arc-20160816; b=XPXCT4uyRE4hEoaQr2uP06WanPUzOUcKMK3neLjIpr3fvWohAT4BLB8Laz3AOmZf9w XQcQ9sU7yHQjruIFWMxQqmmaclnYJzn4peRuCxV5KA+GgupYPRXvc5DVR/S5l+eNRdhh TO1oTYSjSTPx2hjv/8omO8TKSatmg+BUDFTDfuzczywBYRiGXHHYacC9BNVYvlZ15HZa YpO49L/3bVv0zUf/FXQ2akj0dHATd5qCtVi+gELTxlUtd0JFCXtQAWShXUHXqk2Jws2a HgzdLbPxveJsr2Pj44pdZhbOCR5sqXizY6AFGntyH9bAL7SSMS8UXqZf9dzG79OtxbI+ QYkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:to:from:subject; bh=xQqe0E0cENIhDj4Wc9FzvhChJ/7Q42qEhRbQzYZXhro=; b=ZZLcK4cRzkM54cAFvIQnitPVaodbzGSNC8r29ApfdNKiZpBFgReH8eqkxaUGJ6e6On L656aiUAJe+u6fXwizW+I3+wx9tdvZgcmQyStZXnZDXOlrIW1+GQQ6qxv8cEXCIC/4If /sTrUG6C8IWIXlFXoGcgokm++PySFqF60Fyp/UtY+gK8ciZhuU+EgtvG8k1smkhN99ZB IEyV2Gij9R0ES4oCSmKocrvMvugcx/G4CD1l0VaiCvANfnHmVdxvYeLg0nMwizGLg1zm bgr1gELCyUGenMNDsLQKr+G2TZ6NwP2LuomG1mKU2IuvklTWFqNqyjaHMIFGR5Y0DWiD VIAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a63d807000000b0046ec381a28bsi6095920pgh.25.2022.11.12.12.07.49; Sat, 12 Nov 2022 12:08:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbiKLUGL (ORCPT + 99 others); Sat, 12 Nov 2022 15:06:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbiKLUGK (ORCPT ); Sat, 12 Nov 2022 15:06:10 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF0311A25 for ; Sat, 12 Nov 2022 12:06:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 79E0F603F4 for ; Sat, 12 Nov 2022 20:06:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B37D5C433D6 for ; Sat, 12 Nov 2022 20:06:08 +0000 (UTC) Subject: [PATCH] NFSD: Fix trace_nfsd_fh_verify_err() crasher From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Sat, 12 Nov 2022 15:06:07 -0500 Message-ID: <166828356768.42842.2412588018662481301.stgit@klimt.1015granger.net> User-Agent: StGit/1.5.dev3+g9561319 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Now that the nfsd_fh_verify_err() tracepoint is always called on error, it needs to handle cases where the filehandle is not yet fully formed. Fixes: 93c128e709ae ("nfsd: ensure we always call fh_verify_error tracepoint") Signed-off-by: Chuck Lever --- fs/nfsd/trace.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index ef01ecd3eec6..331a33a8f1f8 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -254,7 +254,10 @@ TRACE_EVENT_CONDITION(nfsd_fh_verify_err, rqstp->rq_xprt->xpt_remotelen); __entry->xid = be32_to_cpu(rqstp->rq_xid); __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); - __entry->inode = d_inode(fhp->fh_dentry); + if (fhp->fh_dentry) + __entry->inode = d_inode(fhp->fh_dentry); + else + __entry->inode = NULL; __entry->type = type; __entry->access = access; __entry->error = be32_to_cpu(error);