Commit f419f031 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfsd-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd fixes from Chuck Lever:

 - Avoid exposing parent of root directory in NFSv3 READDIRPLUS results

 - Fix a tracepoint change that went in the initial 5.11 merge

* tag 'nfsd-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
  SUNRPC: Move the svc_xdr_recvfrom tracepoint again
  nfsd4: readdirplus shouldn't return parent of export
parents 28df8580 5f39d271
...@@ -865,9 +865,14 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, ...@@ -865,9 +865,14 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
if (isdotent(name, namlen)) { if (isdotent(name, namlen)) {
if (namlen == 2) { if (namlen == 2) {
dchild = dget_parent(dparent); dchild = dget_parent(dparent);
/* filesystem root - cannot return filehandle for ".." */ /*
* Don't return filehandle for ".." if we're at
* the filesystem or export root:
*/
if (dchild == dparent) if (dchild == dparent)
goto out; goto out;
if (dparent == exp->ex_path.dentry)
goto out;
} else } else
dchild = dget(dparent); dchild = dget(dparent);
} else } else
......
...@@ -1424,13 +1424,61 @@ TRACE_EVENT(rpcb_unregister, ...@@ -1424,13 +1424,61 @@ TRACE_EVENT(rpcb_unregister,
) )
); );
/* Record an xdr_buf containing a fully-formed RPC message */
DECLARE_EVENT_CLASS(svc_xdr_msg_class,
TP_PROTO(
const struct xdr_buf *xdr
),
TP_ARGS(xdr),
TP_STRUCT__entry(
__field(u32, xid)
__field(const void *, head_base)
__field(size_t, head_len)
__field(const void *, tail_base)
__field(size_t, tail_len)
__field(unsigned int, page_len)
__field(unsigned int, msg_len)
),
TP_fast_assign(
__be32 *p = (__be32 *)xdr->head[0].iov_base;
__entry->xid = be32_to_cpu(*p);
__entry->head_base = p;
__entry->head_len = xdr->head[0].iov_len;
__entry->tail_base = xdr->tail[0].iov_base;
__entry->tail_len = xdr->tail[0].iov_len;
__entry->page_len = xdr->page_len;
__entry->msg_len = xdr->len;
),
TP_printk("xid=0x%08x head=[%p,%zu] page=%u tail=[%p,%zu] len=%u",
__entry->xid,
__entry->head_base, __entry->head_len, __entry->page_len,
__entry->tail_base, __entry->tail_len, __entry->msg_len
)
);
#define DEFINE_SVCXDRMSG_EVENT(name) \
DEFINE_EVENT(svc_xdr_msg_class, \
svc_xdr_##name, \
TP_PROTO( \
const struct xdr_buf *xdr \
), \
TP_ARGS(xdr))
DEFINE_SVCXDRMSG_EVENT(recvfrom);
/* Record an xdr_buf containing arbitrary data, tagged with an XID */
DECLARE_EVENT_CLASS(svc_xdr_buf_class, DECLARE_EVENT_CLASS(svc_xdr_buf_class,
TP_PROTO( TP_PROTO(
const struct svc_rqst *rqst, __be32 xid,
const struct xdr_buf *xdr const struct xdr_buf *xdr
), ),
TP_ARGS(rqst, xdr), TP_ARGS(xid, xdr),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(u32, xid) __field(u32, xid)
...@@ -1443,7 +1491,7 @@ DECLARE_EVENT_CLASS(svc_xdr_buf_class, ...@@ -1443,7 +1491,7 @@ DECLARE_EVENT_CLASS(svc_xdr_buf_class,
), ),
TP_fast_assign( TP_fast_assign(
__entry->xid = be32_to_cpu(rqst->rq_xid); __entry->xid = be32_to_cpu(xid);
__entry->head_base = xdr->head[0].iov_base; __entry->head_base = xdr->head[0].iov_base;
__entry->head_len = xdr->head[0].iov_len; __entry->head_len = xdr->head[0].iov_len;
__entry->tail_base = xdr->tail[0].iov_base; __entry->tail_base = xdr->tail[0].iov_base;
...@@ -1463,12 +1511,11 @@ DECLARE_EVENT_CLASS(svc_xdr_buf_class, ...@@ -1463,12 +1511,11 @@ DECLARE_EVENT_CLASS(svc_xdr_buf_class,
DEFINE_EVENT(svc_xdr_buf_class, \ DEFINE_EVENT(svc_xdr_buf_class, \
svc_xdr_##name, \ svc_xdr_##name, \
TP_PROTO( \ TP_PROTO( \
const struct svc_rqst *rqst, \ __be32 xid, \
const struct xdr_buf *xdr \ const struct xdr_buf *xdr \
), \ ), \
TP_ARGS(rqst, xdr)) TP_ARGS(xid, xdr))
DEFINE_SVCXDRBUF_EVENT(recvfrom);
DEFINE_SVCXDRBUF_EVENT(sendto); DEFINE_SVCXDRBUF_EVENT(sendto);
/* /*
......
...@@ -857,6 +857,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) ...@@ -857,6 +857,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
err = -EAGAIN; err = -EAGAIN;
if (len <= 0) if (len <= 0)
goto out_release; goto out_release;
trace_svc_xdr_recvfrom(&rqstp->rq_arg);
clear_bit(XPT_OLD, &xprt->xpt_flags); clear_bit(XPT_OLD, &xprt->xpt_flags);
...@@ -866,7 +867,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) ...@@ -866,7 +867,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
if (serv->sv_stats) if (serv->sv_stats)
serv->sv_stats->netcnt++; serv->sv_stats->netcnt++;
trace_svc_xdr_recvfrom(rqstp, &rqstp->rq_arg);
return len; return len;
out_release: out_release:
rqstp->rq_res.len = 0; rqstp->rq_res.len = 0;
...@@ -904,7 +904,7 @@ int svc_send(struct svc_rqst *rqstp) ...@@ -904,7 +904,7 @@ int svc_send(struct svc_rqst *rqstp)
xb->len = xb->head[0].iov_len + xb->len = xb->head[0].iov_len +
xb->page_len + xb->page_len +
xb->tail[0].iov_len; xb->tail[0].iov_len;
trace_svc_xdr_sendto(rqstp, xb); trace_svc_xdr_sendto(rqstp->rq_xid, xb);
trace_svc_stats_latency(rqstp); trace_svc_stats_latency(rqstp);
len = xprt->xpt_ops->xpo_sendto(rqstp); len = xprt->xpt_ops->xpo_sendto(rqstp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment