Skip to content

Commit fd6d93c

Browse files
Mike SnitzerAnna Schumaker
authored andcommitted
nfs/localio: make trace_nfs_local_open_fh more useful
Always trigger trace event when LOCALIO opens a file. Signed-off-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
1 parent d11f6cd commit fd6d93c

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

fs/nfs/localio.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ __nfs_local_open_fh(struct nfs_client *clp, const struct cred *cred,
231231
struct nfsd_file __rcu **pnf,
232232
const fmode_t mode)
233233
{
234+
int status = 0;
234235
struct nfsd_file *localio;
235236

236237
localio = nfs_open_local_fh(&clp->cl_uuid, clp->cl_rpcclient,
237238
cred, fh, nfl, pnf, mode);
238239
if (IS_ERR(localio)) {
239-
int status = PTR_ERR(localio);
240-
trace_nfs_local_open_fh(fh, mode, status);
240+
status = PTR_ERR(localio);
241241
switch (status) {
242242
case -ENOMEM:
243243
case -ENXIO:
@@ -247,6 +247,7 @@ __nfs_local_open_fh(struct nfs_client *clp, const struct cred *cred,
247247
nfs_local_probe(clp);
248248
}
249249
}
250+
trace_nfs_local_open_fh(fh, mode, status);
250251
return localio;
251252
}
252253

fs/nfs/nfstrace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,10 +1846,10 @@ TRACE_EVENT(nfs_local_open_fh,
18461846
),
18471847

18481848
TP_printk(
1849-
"error=%d fhandle=0x%08x mode=%s",
1850-
__entry->error,
1849+
"fhandle=0x%08x mode=%s result=%d",
18511850
__entry->fhandle,
1852-
show_fs_fmode_flags(__entry->fmode)
1851+
show_fs_fmode_flags(__entry->fmode),
1852+
__entry->error
18531853
)
18541854
);
18551855

0 commit comments

Comments
 (0)