2012-07-19 09:27:36

by Boaz Harrosh

[permalink] [raw]
Subject: Re: [PATCH] pnfs-obj: fix inline XDR size in _osd_xdr_decode_opaque_cred

On 07/18/2012 12:22 PM, Idan Kedar wrote:

> if the length is __be32, at least sizeof(__be32) bytes have to be
> decoded. this is just semantics since __xdr_inline_decode rounds nbytes
> up by calling XDR_QUADLEN(nbytes), but the code is still better off
> fixed.
>


ACK-by: Boaz Harrosh <[email protected]>

> Signed-off-by: Idan Kedar <[email protected]>


This is for Trond for the 3.6 merge window.

> ---
> fs/nfs/objlayout/pnfs_osd_xdr_cli.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/objlayout/pnfs_osd_xdr_cli.c b/fs/nfs/objlayout/pnfs_osd_xdr_cli.c
> index b3918f7..3845ece 100644
> --- a/fs/nfs/objlayout/pnfs_osd_xdr_cli.c
> +++ b/fs/nfs/objlayout/pnfs_osd_xdr_cli.c
> @@ -73,7 +73,7 @@ static int
> _osd_xdr_decode_opaque_cred(struct pnfs_osd_opaque_cred *opaque_cred,
> struct xdr_stream *xdr)
> {
> - __be32 *p = xdr_inline_decode(xdr, 1);
> + __be32 *p = xdr_inline_decode(xdr, sizeof(__be32));
>
> if (!p)
> return -EINVAL;