]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
NFSD: Fix trace_nfsd_fh_verify_err() crasher
authorChuck Lever <chuck.lever@oracle.com>
Sat, 12 Nov 2022 20:06:07 +0000 (15:06 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 14 Nov 2022 13:43:35 +0000 (08:43 -0500)
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: 93c128e709ae ("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>
fs/nfsd/trace.h

index 06a96e955bd00dca4cbf3bfd33cd9ba4b165a531..d4b6839bb459a53d2e6fe29e2e8d58ca6b6f9112 100644 (file)
@@ -254,7 +254,10 @@ TRACE_EVENT_CONDITION(nfsd_fh_verify_err,
                                  rqstp->rq_xprt->xpt_remotelen);
                __entry->xid = be32_to_cpu(rqstp->rq_xid);
                __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
-               __entry->inode = d_inode(fhp->fh_dentry);
+               if (fhp->fh_dentry)
+                       __entry->inode = d_inode(fhp->fh_dentry);
+               else
+                       __entry->inode = NULL;
                __entry->type = type;
                __entry->access = access;
                __entry->error = be32_to_cpu(error);