From patchwork Fri Nov 3 10:10:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13444453 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 DC1AEC4167B for ; Fri, 3 Nov 2023 10:11:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347767AbjKCKLB (ORCPT ); Fri, 3 Nov 2023 06:11:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347633AbjKCKLA (ORCPT ); Fri, 3 Nov 2023 06:11:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D13A5D45; Fri, 3 Nov 2023 03:10:57 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EBCBC433C9; Fri, 3 Nov 2023 10:10:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699006257; bh=6vgNTfCui7BrBTIbjiewHjd4liJmt8Js2DbVuOdSPNc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Pr/+UMMo3widSwR/E2RhKMvQdy0g+u8eYZ5pDbSleoJNlsVJssQ2eJwK/Vhn36rdf kHMyOCMg9D7xRhd9AgblnGewW7Wrljaqnx6aAVftHn3f+RHwH05MTU5OiXsJZ4vOHi 8em9nMvibEJwHzdUGqaXA5Kw7QtYNU9cGxWk1nUUctQz5/76h94sfWOFHpUlkJ0Ee0 /znZF583bxlFBeceADWukhQ1V4DS5M/SG9YWKc9++nHx2yrHN2cCNeWeFxjvHkpEuI dRSSw3cckINqBQXfsHr2i/i1K0vgOt4et6oYB6rQspNbxT08jAJEVjUHh8gW9SYnBy cbHcBsxHGfFdA== From: Jeff Layton Date: Fri, 03 Nov 2023 06:10:49 -0400 Subject: [PATCH 1/3] nfs: add new tracepoint at nfs4 revalidate entry point MIME-Version: 1.0 Message-Id: <20231103-nfs-6-8-v1-1-a2aa9021dc1d@kernel.org> References: <20231103-nfs-6-8-v1-0-a2aa9021dc1d@kernel.org> In-Reply-To: <20231103-nfs-6-8-v1-0-a2aa9021dc1d@kernel.org> To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=615; i=jlayton@kernel.org; h=from:subject:message-id; bh=6vgNTfCui7BrBTIbjiewHjd4liJmt8Js2DbVuOdSPNc=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlRMcvWyZSnjgAhr2+BctpREsmfKGQG1+F9up9O xNgMC3H1NOJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZUTHLwAKCRAADmhBGVaC FfB0EADAJjnkLertPKMP/l4lTa1wgOPY3WVPvWGgVyA04ET9B2EbEp/P7Y6PEjpJCD1vro+ADrR dTd0haeO+SLPPeSTFr4Gx0CJ37C+0B3IlcsGF1pheUVTZvYLLfsOat7/8kfn5iCn2svae7NZAP1 8oWkUef7Q1E5W8rlEzat0A7T+xVg7ozd/pPXu9jjjZFzUXA6uhYr3d7KEc0KqJdfFxTkHd+RCHN A98x73L4FITriS5HIUxQ9KXZey0RAFLIcLuBIuI/e59xHz1ZzPTVclSOhmU8Oi8VNulBQtRGzQE NHmi0pODpVqQNXU5I2vIORE2xhtGVkzD6WMYM9hqeUJB6yFVCcmK09WTecyKP21WGpdf+/wh8FA 9JKMl1z81TyoZqHObtP407noFZX4PeF7f4oENY7IP5guobH5C5SoxdlEhuL5aq5ry0yfsN4Hku+ n3qCfD7oD5onaseNSFYkvLsc56pee9ywbNL2e8sr8us1yQRg6nNInFkv5JaYqWI9S6DqyhnKjza mGR7GvTPAwf87fQ2+MENNp6X2bsFBxtEVFwy+7ISTQFk3owjOGHOpTPEH6XmvY4drF8rfaiNjtG hPzu3X8gGr4M8jaUFTGfaA49sOBGqjRKu+P5yYqAUeAo/pKBlRRnAdmniesH/cozLGvE9sS31jc MkTq8PeC71kdZxQ== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Add a call to the v4 d_revalidate entrypoint, just like the v3 one. Signed-off-by: Jeff Layton --- fs/nfs/dir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index e6a51fd94fea..ccb6f5d85a68 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2194,6 +2194,8 @@ nfs4_do_lookup_revalidate(struct inode *dir, struct dentry *dentry, { struct inode *inode; + trace_nfs_lookup_revalidate_enter(dir, dentry, flags); + if (!(flags & LOOKUP_OPEN) || (flags & LOOKUP_DIRECTORY)) goto full_reval; if (d_mountpoint(dentry)) From patchwork Fri Nov 3 10:10:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13444454 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 86C49C0018A for ; Fri, 3 Nov 2023 10:11:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347780AbjKCKLB (ORCPT ); Fri, 3 Nov 2023 06:11:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347735AbjKCKLB (ORCPT ); Fri, 3 Nov 2023 06:11:01 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C2A0BD; Fri, 3 Nov 2023 03:10:58 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B99F7C433CC; Fri, 3 Nov 2023 10:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699006258; bh=aEwR2a88wWo7zxzWtx4+bapNUSG0wCpCSwkXs01II2I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IgcIEcpsl/8hIBYRrJwoF0KrW3rX5hGwRRjs3cUQrghLZ9d3rozwe96iGrVrzkG6F 3CJBZKLKD7xF4icfvj1C6sIoNmBclFxrkkNJQTTRrbyCrB2YRH6Z51NXbRz2Px6o5z 6jwuKg0h59YeHBb5VOIisTUMqX2Xld4Dv1wK+czVE3QCIQ3uY+Ppvox7ftiFa0oMXN xlRccMkAxHRE96QZ4s8hU2Ahtjhue/kUGqCNRvu64frbB7lbA01ZnIEN+QF/G8cWNL qQI+nokl0meS0DQXgT/4epg843ZQq2ej+rt7ggYaFO/wjuIm8pp6vCux100SnU1Q8+ JC5zHvT0aUx2A== From: Jeff Layton Date: Fri, 03 Nov 2023 06:10:50 -0400 Subject: [PATCH 2/3] nfs: rename the nfs_async_rename_done tracepoint MIME-Version: 1.0 Message-Id: <20231103-nfs-6-8-v1-2-a2aa9021dc1d@kernel.org> References: <20231103-nfs-6-8-v1-0-a2aa9021dc1d@kernel.org> In-Reply-To: <20231103-nfs-6-8-v1-0-a2aa9021dc1d@kernel.org> To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1332; i=jlayton@kernel.org; h=from:subject:message-id; bh=aEwR2a88wWo7zxzWtx4+bapNUSG0wCpCSwkXs01II2I=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlRMcwit8w99fq4KjPsRSUpqRRz5GxUAP6idpx0 s2gLu5iRICJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZUTHMAAKCRAADmhBGVaC FYdHEAC+e+8cdamQyLjy+g//UDgf2TbbzrbnvEeJavqTIHrXLTlAi8WVc3Wx04MfEa+EM44sB2p n538F49kpSdYyDjP/C4zF44mHT0mP9/yi96cC8TsGAVu5floDO8NC4n2eoI7nykRGcBH266+5TK IwhrfxkcfXg8RzrrnmaCIMNl9168HCDShYVgYZf3fEXjdEWVscdIC25xSRSW5T6+R2WPG4Tl7+Z 0v0EWkfTOBvG0P+D4KZDY4Z9GWVoJ97jQ1V74yGfgtODphNI1+a6+5SgCieY3pHa3guzbMJUUoU TlqdderWkpUfc5TRPjsA8yR73QnhisYhMkfqKsVWuMiBBz6u2LkU0bN6m3tBh35XWrLYXTUqoSc Dy7Z16x/2oKFrw4A4xxd/ZJwCGiPoZmJjyjPIOYcH0rd6RA4hwjUj1eyl0txDTgm81kmGGsFoDH dz7J80oZzAE/KO0XvDBx8s7X7nC4b+H+hJdk03tpMJMaIbsRkmzZzWUhhfYRKC+ex+q2cpB3PxG dSVMPbn7tYM5lgnNnzNVyHtxyqFDGWq+9zBslV4tjb2yo2hnQpIdD0cKUkLc9QlFHxP0Sc7sQv5 4TNrw4N/Oq6vT81mhQHXwBTmLSr46vswmH5pwu3Uj6X7eS3UEaxxobzvOTw8PqqcWj61E/j2kEg DBNZFQAbwUiIhdg== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org We do async renames in other cases besides sillyrenames now. This tracepoint name is now misleading. Signed-off-by: Jeff Layton --- fs/nfs/nfstrace.h | 2 +- fs/nfs/unlink.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h index 4e90ca531176..8ad1bed09295 100644 --- a/fs/nfs/nfstrace.h +++ b/fs/nfs/nfstrace.h @@ -893,7 +893,7 @@ DECLARE_EVENT_CLASS(nfs_rename_event_done, DEFINE_NFS_RENAME_EVENT(nfs_rename_enter); DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit); -DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename); +DEFINE_NFS_RENAME_EVENT_DONE(nfs_async_rename_done); TRACE_EVENT(nfs_sillyrename_unlink, TP_PROTO( diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index 150a953a8be9..0110299643a2 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c @@ -267,7 +267,7 @@ static void nfs_async_rename_done(struct rpc_task *task, void *calldata) struct inode *new_dir = data->new_dir; struct dentry *old_dentry = data->old_dentry; - trace_nfs_sillyrename_rename(old_dir, old_dentry, + trace_nfs_async_rename_done(old_dir, old_dentry, new_dir, data->new_dentry, task->tk_status); if (!NFS_PROTO(old_dir)->rename_done(task, old_dir, new_dir)) { rpc_restart_call_prepare(task); From patchwork Fri Nov 3 10:10:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13444455 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 2EB46C4332F for ; Fri, 3 Nov 2023 10:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347602AbjKCKLD (ORCPT ); Fri, 3 Nov 2023 06:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347786AbjKCKLC (ORCPT ); Fri, 3 Nov 2023 06:11:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C7F213E; Fri, 3 Nov 2023 03:10:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EACBC433C7; Fri, 3 Nov 2023 10:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699006258; bh=hy5EV4sR4yz3zAHZYgoj1HfAxunSfRMU8lTP11JOGFg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UVMpTv8+gH/tpaomJ0+e/TeBVbFo9WZ47PL52wHCVW2q9WdkQ/ZQcLw3oUUYFP7MM IwnSqP6901vRxGjyEcPU4HGaZyN2cia2b8yNDu/9J7k08cVqIEkG2RmdKJzpMtFqGj LhcREJ2xMi3P9aKJnVrwX4D+4lDp+hhuooHKSja0G3aW4fOxuncZJ2cH9moI54CkKu YsEzmQC8hsJ6bcl/pzJnps0LnGbCeqv9B+krSijMVIF2slGsVOfjrVBSc6sK6P52nQ ilYYWpN6pI65citM7/0DlmRdghBa6LVp2OBDAefCZ2sg6ElNAKY8VLeciXaCGJcCZA 1PJ4mBneFwKDA== From: Jeff Layton Date: Fri, 03 Nov 2023 06:10:51 -0400 Subject: [PATCH 3/3] nfs: print fileid in lookup tracepoints MIME-Version: 1.0 Message-Id: <20231103-nfs-6-8-v1-3-a2aa9021dc1d@kernel.org> References: <20231103-nfs-6-8-v1-0-a2aa9021dc1d@kernel.org> In-Reply-To: <20231103-nfs-6-8-v1-0-a2aa9021dc1d@kernel.org> To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2268; i=jlayton@kernel.org; h=from:subject:message-id; bh=hy5EV4sR4yz3zAHZYgoj1HfAxunSfRMU8lTP11JOGFg=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlRMcwerZerSmW0zQ23tKiLtc/KI/L1+K8h3qeS 2vhQR5NQmqJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZUTHMAAKCRAADmhBGVaC FWbtD/9tXHGqmIca1dJtzDkko7bd2dQ9/06sp6/+hv53Mxkc6v9GLa5b3Fql0lK5JrjAw5dL6ZB 2oeuBUuuk8C5RBYyepA5U74xRTelZoetsy9FiDx6kbLPne4IzMcSuJrpgFP0Wp4H5QydF5b9YLs WQAkB/LCwOlcDz+nit/zToeouvGqYuFnQ0CsM5zUsxCVXG0so2y8zPMzd6auxIsmOIS7xQggxy/ dx439lGP+MY4dKMfsdIt5bfjWA6JBDFGTGvIIq922JH6FahCBXN5EQME9y+Y+W4PuXqShpNh25h Vs04QRaBDiuJ9UhvlChslR6xroQUNo4zFZhbrBtRJjVv55TAh7PU/vKsjCwwHu8IWcjr4zkk1Bk +kfP5he5uIzoRefutumKoHDjabZwt+G7L2zkp8Ln+SDSF0bjlxAo/Art9oNiuXMcp4H8ZP4X+J4 sJkTc91aWlAzcuDQVxGgo+d83Rh1BZ6RzHZIBkv+bbN/AqScHnC4gXfgwyivF+A5xVnES1+OCoJ Bg6vJ1ulGRnVH2dq+Q974BzqsXDDAEX+YbTybtRlD9GNYn+ZsEBmJAS9qyAGVq3s5jyKGVkUdvT WW4XcI7BsoK8fTFUGxaDUEWJYcZinWmyzJxCDhPjkysO8X8hSdq7AwAB//IigJCIV/1IKfql9/r CI2Zhh+O4SAYAtw== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org With this we can see the dentry -> inode linkage that's being revalidated. A fileid of 0 means "negative dentry". Signed-off-by: Jeff Layton --- fs/nfs/nfstrace.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h index 8ad1bed09295..de3adc4a2ce0 100644 --- a/fs/nfs/nfstrace.h +++ b/fs/nfs/nfstrace.h @@ -400,6 +400,7 @@ DECLARE_EVENT_CLASS(nfs_lookup_event, __field(unsigned long, flags) __field(dev_t, dev) __field(u64, dir) + __field(u64, fileid) __string(name, dentry->d_name.name) ), @@ -407,16 +408,18 @@ DECLARE_EVENT_CLASS(nfs_lookup_event, __entry->dev = dir->i_sb->s_dev; __entry->dir = NFS_FILEID(dir); __entry->flags = flags; + __entry->fileid = d_is_negative(dentry) ? 0 : NFS_FILEID(d_inode(dentry)); __assign_str(name, dentry->d_name.name); ), TP_printk( - "flags=0x%lx (%s) name=%02x:%02x:%llu/%s", + "flags=0x%lx (%s) name=%02x:%02x:%llu/%s fileid=%llu", __entry->flags, show_fs_lookup_flags(__entry->flags), MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long long)__entry->dir, - __get_str(name) + __get_str(name), + __entry->fileid ) ); @@ -444,6 +447,7 @@ DECLARE_EVENT_CLASS(nfs_lookup_event_done, __field(unsigned long, flags) __field(dev_t, dev) __field(u64, dir) + __field(u64, fileid) __string(name, dentry->d_name.name) ), @@ -452,17 +456,19 @@ DECLARE_EVENT_CLASS(nfs_lookup_event_done, __entry->dir = NFS_FILEID(dir); __entry->error = error < 0 ? -error : 0; __entry->flags = flags; + __entry->fileid = d_is_negative(dentry) ? 0 : NFS_FILEID(d_inode(dentry)); __assign_str(name, dentry->d_name.name); ), TP_printk( - "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s", + "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s fileid=%llu", -__entry->error, show_nfs_status(__entry->error), __entry->flags, show_fs_lookup_flags(__entry->flags), MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long long)__entry->dir, - __get_str(name) + __get_str(name), + __entry->fileid ) );