From: Anna Schumaker <Anna.Schumaker-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
To: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
trond Myklebust
<trond.myklebust-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
Subject: Re: [PATCH v2 09/10] NFS: SETCLIENTID XDR buffer sizes are incorrect
Date: Mon, 10 Nov 2014 10:22:50 -0500 [thread overview]
Message-ID: <5460D84A.3050704@Netapp.com> (raw)
In-Reply-To: <20141109011518.8806.36904.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
Hi Chuck,
It looks like this patch and the next one are general client changes, so they might have to be submitted to Trond directly rather than going through my tree. Trond, what do you think?
Anna
On 11/08/2014 08:15 PM, Chuck Lever wrote:
> Use the correct calculation of the maximum size of a clientaddr4
> when encoding and decoding SETCLIENTID operations. clientaddr4 is
> defined in section 2.2.10 of RFC3530bis-31.
>
> The usage in encode_setclientid_maxsz is missing the 4-byte length
> in both strings, but is otherwise correct. decode_setclientid_maxsz
> simply asks for a page of receive buffer space, which is
> unnecessarily large (more than 4KB).
>
> Note that a SETCLIENTID reply is either clientid+verifier, or
> clientaddr4, depending on the returned NFS status. It doesn't
> hurt to allocate enough space for both.
>
> Signed-off-by: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
> fs/nfs/nfs4xdr.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
> index 206c08a..f8afa67 100644
> --- a/fs/nfs/nfs4xdr.c
> +++ b/fs/nfs/nfs4xdr.c
> @@ -141,13 +141,15 @@ static int nfs4_stat_to_errno(int);
> XDR_QUADLEN(NFS4_VERIFIER_SIZE) + \
> XDR_QUADLEN(NFS4_SETCLIENTID_NAMELEN) + \
> 1 /* sc_prog */ + \
> - XDR_QUADLEN(RPCBIND_MAXNETIDLEN) + \
> - XDR_QUADLEN(RPCBIND_MAXUADDRLEN) + \
> + 1 + XDR_QUADLEN(RPCBIND_MAXNETIDLEN) + \
> + 1 + XDR_QUADLEN(RPCBIND_MAXUADDRLEN) + \
> 1) /* sc_cb_ident */
> #define decode_setclientid_maxsz \
> (op_decode_hdr_maxsz + \
> - 2 + \
> - 1024) /* large value for CLID_INUSE */
> + 2 /* clientid */ + \
> + XDR_QUADLEN(NFS4_VERIFIER_SIZE) + \
> + 1 + XDR_QUADLEN(RPCBIND_MAXNETIDLEN) + \
> + 1 + XDR_QUADLEN(RPCBIND_MAXUADDRLEN))
> #define encode_setclientid_confirm_maxsz \
> (op_encode_hdr_maxsz + \
> 3 + (NFS4_VERIFIER_SIZE >> 2))
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-11-10 15:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-09 1:14 [PATCH v2 00/10] NFS/RDMA patches for 3.19 Chuck Lever
[not found] ` <20141109010328.8806.5861.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2014-11-09 1:14 ` [PATCH v2 01/10] xprtrdma: Return an errno from rpcrdma_register_external() Chuck Lever
2014-11-09 1:14 ` [PATCH v2 02/10] xprtrdma: Cap req_cqinit Chuck Lever
[not found] ` <20141109011420.8806.1849.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2014-11-09 10:13 ` Sagi Grimberg
[not found] ` <545F3E46.9040703-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-11-09 21:43 ` Chuck Lever
2014-11-09 1:14 ` [PATCH v2 03/10] xprtrdma: unmap all FMRs during transport disconnect Chuck Lever
2014-11-09 1:14 ` [PATCH v2 04/10] xprtrdma: Refactor tasklet scheduling Chuck Lever
2014-11-09 1:14 ` [PATCH v2 05/10] xprtrdma: Re-write rpcrdma_flush_cqs() Chuck Lever
2014-11-09 1:14 ` [PATCH v2 06/10] xprtrdma: Enable pad optimization Chuck Lever
[not found] ` <20141109011453.8806.31817.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2014-11-10 14:36 ` Anna Schumaker
[not found] ` <5460CD53.1080301-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2014-11-10 14:54 ` Chuck Lever
[not found] ` <89410A6C-693C-4FB2-A0AB-5698803F3AFC-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2014-11-10 15:05 ` J. Bruce Fields
2014-11-09 1:15 ` [PATCH v2 07/10] xprtrdma: Display async errors Chuck Lever
[not found] ` <20141109011501.8806.23478.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2014-11-11 14:30 ` Sagi Grimberg
[not found] ` <54621D8D.7050508-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-11-11 16:52 ` Chuck Lever
[not found] ` <1D304B95-D745-42B2-9324-143A5002FB35-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-11 18:49 ` Sagi Grimberg
[not found] ` <54625A33.6000506-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-11-11 20:30 ` Or Gerlitz
2014-11-09 1:15 ` [PATCH v2 08/10] SUNRPC: serialize iostats updates Chuck Lever
2014-11-09 1:15 ` [PATCH v2 09/10] NFS: SETCLIENTID XDR buffer sizes are incorrect Chuck Lever
[not found] ` <20141109011518.8806.36904.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2014-11-10 15:22 ` Anna Schumaker [this message]
[not found] ` <5460D84A.3050704-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2014-11-10 16:21 ` Trond Myklebust
2014-11-09 1:15 ` [PATCH v2 10/10] NFS: Clean up nfs4_init_callback() Chuck Lever
2014-11-26 16:25 ` [PATCH v2 00/10] NFS/RDMA patches for 3.19 Anna Schumaker
[not found] ` <5475FEFD.8070302-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2014-11-26 16:36 ` Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5460D84A.3050704@Netapp.com \
--to=anna.schumaker-hgovqubeegtqt0dzr+alfa@public.gmane.org \
--cc=chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=trond.myklebust-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox