From 8252138376a2ba3e53807fafab9c382b6acf503f Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Thu, 15 Jun 2023 13:13:47 -0400 Subject: [PATCH] NFS: Olga's prink() patch Adds a handful of printk() statements to print out the state of the xdr stream. --- fs/nfs/nfs42xdr.c | 5 +++++ net/sunrpc/clnt.c | 1 + net/sunrpc/xdr.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index 6a4eade2400b..22628057d080 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -352,6 +352,7 @@ static void encode_read_plus(struct xdr_stream *xdr, const struct nfs_pgio_args *args, struct compound_hdr *hdr) { + printk("AGLO: %s setting up decode buffer size=%d\n", __func__, decode_read_plus_maxsz); encode_op_hdr(xdr, OP_READ_PLUS, decode_read_plus_maxsz, hdr); encode_nfs4_stateid(xdr, &args->stateid); encode_uint64(xdr, args->offset); @@ -1065,6 +1066,7 @@ static int decode_read_plus_segment(struct xdr_stream *xdr, { __be32 *p; + printk("AGLO: %s start seg=%p\n", __func__, seg); p = xdr_inline_decode(xdr, 4); if (!p) return -EIO; @@ -1088,6 +1090,7 @@ static int decode_read_plus_segment(struct xdr_stream *xdr, xdr_decode_hyper(p, &seg->hole.length); } else return -EINVAL; + printk("AGLO: %s end seg=%p xdr->nwords=%d\n", __func__, seg, xdr->nwords); return 0; } @@ -1130,6 +1133,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res) int status, i; __be32 *p; + printk("AGLO: %s START\n", __func__); status = decode_op_hdr(xdr, OP_READ_PLUS); if (status) return status; @@ -1161,6 +1165,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res) out: kfree(segs); + printk("AGLO: %s END\n", __func__); return status; } diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index d2ee56634308..4426a25d0152 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1337,6 +1337,7 @@ void rpc_prepare_reply_pages(struct rpc_rqst *req, struct page **pages, { hdrsize += RPC_REPHDRSIZE + req->rq_cred->cr_auth->au_ralign; + printk("AGLO: %s hdrsize %d (<<2 %d) HDRSIZE %d auligh %d\n", __func__, hdrsize, hdrsize << 2, RPC_REPHDRSIZE, req->rq_cred->cr_auth->au_ralign); xdr_inline_pages(&req->rq_rcv_buf, hdrsize << 2, pages, base, len); trace_rpc_xdr_reply_pages(req->rq_task, &req->rq_rcv_buf); } diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 37c8f7e519dd..7f635f601dd4 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -1422,6 +1422,7 @@ static __be32 * __xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes) __be32 *p = xdr->p; __be32 *q = p + nwords; + printk("AGLO: %s nwords=%d xdr->nwords=%d q=%p xdr->end=%p p=%p (%d %d)\n", __func__, nwords, xdr->nwords, q, xdr->end, p, q > xdr->end, q < p); if (unlikely(nwords > xdr->nwords || q > xdr->end || q < p)) return NULL; xdr->p = q; @@ -1435,6 +1436,7 @@ static __be32 *xdr_copy_to_scratch(struct xdr_stream *xdr, size_t nbytes) char *cpdest = xdr->scratch.iov_base; size_t cplen = (char *)xdr->end - (char *)xdr->p; + printk("AGLO: %s here\n", __func__); if (nbytes > xdr->scratch.iov_len) goto out_overflow; p = __xdr_inline_decode(xdr, cplen); -- 2.41.0