NFS: Instrument i_size_write()
authorChuck Lever <chuck.lever@oracle.com>
Mon, 4 Oct 2021 14:10:16 +0000 (10:10 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 10 Oct 2021 09:05:54 +0000 (11:05 +0200)
commit110cb2d2f9326030f13b7ec85d6d482934ea5462
treeca5710abdebc4da93d2593c872c994881158015f
parent0392dd51f9c78d46109a408f27dc820300dcd8bd
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>
fs/nfs/inode.c
fs/nfs/nfstrace.h
fs/nfs/write.c