Skip to content

Commit 5a01c80

Browse files
committed
NFSD: Fix trace_nfsd_fh_verify_err() crasher
Now that the nfsd_fh_verify_err() tracepoint is always called on error, it needs to handle cases where the filehandle is not yet fully formed. Fixes: 93c128e ("nfsd: ensure we always call fh_verify_error tracepoint") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Jeff Layton <jlayton@kernel.org>
1 parent 50256e4 commit 5a01c80

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/nfsd/trace.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,10 @@ TRACE_EVENT_CONDITION(nfsd_fh_verify_err,
254254
rqstp->rq_xprt->xpt_remotelen);
255255
__entry->xid = be32_to_cpu(rqstp->rq_xid);
256256
__entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
257-
__entry->inode = d_inode(fhp->fh_dentry);
257+
if (fhp->fh_dentry)
258+
__entry->inode = d_inode(fhp->fh_dentry);
259+
else
260+
__entry->inode = NULL;
258261
__entry->type = type;
259262
__entry->access = access;
260263
__entry->error = be32_to_cpu(error);

0 commit comments

Comments
 (0)