aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2021-10-04 10:10:16 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-10-10 11:05:54 +0200
commit110cb2d2f9326030f13b7ec85d6d482934ea5462 (patch)
treeca5710abdebc4da93d2593c872c994881158015f /fs/nfs/write.c
parentSUNRPC: Per-rpc_clnt task PIDs (diff)
downloadlinux-dev-110cb2d2f9326030f13b7ec85d6d482934ea5462.tar.xz
linux-dev-110cb2d2f9326030f13b7ec85d6d482934ea5462.zip
NFS: Instrument i_size_write()
Generate a trace event whenever the NFS client modifies the size of a file. These new events aid troubleshooting workloads that trigger races around size updates. There are four new trace points, all named nfs_size_something so they are easy to grep for or enable as a group with a single glob. Size updated on the server: kworker/u24:10-194 [010] 369.939174: nfs_size_update: fileid=00:28:2 fhandle=0x36fbbe51 version=1752899344277980615 cursize=250471 newsize=172083 Server-side size update reported via NFSv3 WCC attributes: fsx-1387 [006] 380.760686: nfs_size_wcc: fileid=00:28:2 fhandle=0x36fbbe51 version=1752899355909932456 cursize=146792 newsize=171216 File has been truncated locally: fsx-1387 [007] 369.437421: nfs_size_truncate: fileid=00:28:2 fhandle=0x36fbbe51 version=1752899231200117272 cursize=215244 newsize=0 File has been extended locally: fsx-1387 [007] 369.439213: nfs_size_grow: fileid=00:28:2 fhandle=0x36fbbe51 version=1752899343704248410 cursize=258048 newsize=262144 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/write.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 773ea2c8504d..b89d5ef3af0e 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -288,6 +288,7 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c
end = page_file_offset(page) + ((loff_t)offset+count);
if (i_size >= end)
goto out;
+ trace_nfs_size_grow(inode, end);
i_size_write(inode, end);
NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_SIZE;
nfs_inc_stats(inode, NFSIOS_EXTENDWRITE);