From: Mike Snitzer Date: Fri, 19 Sep 2025 14:36:25 +0000 (-0400) Subject: nfs/localio: make trace_nfs_local_open_fh more useful X-Git-Tag: v6.18-rc1~109^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd6d93c2b79ded0a447502ce5c8a9a549c697819;p=thirdparty%2Flinux.git nfs/localio: make trace_nfs_local_open_fh more useful Always trigger trace event when LOCALIO opens a file. Signed-off-by: Mike Snitzer Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c index 97abf62f109d2..42ea50d42c995 100644 --- a/fs/nfs/localio.c +++ b/fs/nfs/localio.c @@ -231,13 +231,13 @@ __nfs_local_open_fh(struct nfs_client *clp, const struct cred *cred, struct nfsd_file __rcu **pnf, const fmode_t mode) { + int status = 0; struct nfsd_file *localio; localio = nfs_open_local_fh(&clp->cl_uuid, clp->cl_rpcclient, cred, fh, nfl, pnf, mode); if (IS_ERR(localio)) { - int status = PTR_ERR(localio); - trace_nfs_local_open_fh(fh, mode, status); + status = PTR_ERR(localio); switch (status) { case -ENOMEM: case -ENXIO: @@ -247,6 +247,7 @@ __nfs_local_open_fh(struct nfs_client *clp, const struct cred *cred, nfs_local_probe(clp); } } + trace_nfs_local_open_fh(fh, mode, status); return localio; } diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h index 1356ce10236ac..b51f0fa9e9afe 100644 --- a/fs/nfs/nfstrace.h +++ b/fs/nfs/nfstrace.h @@ -1846,10 +1846,10 @@ TRACE_EVENT(nfs_local_open_fh, ), TP_printk( - "error=%d fhandle=0x%08x mode=%s", - __entry->error, + "fhandle=0x%08x mode=%s result=%d", __entry->fhandle, - show_fs_fmode_flags(__entry->fmode) + show_fs_fmode_flags(__entry->fmode), + __entry->error ) );