Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Jorge Mora <jmora1300@gmail.com>, linux-nfs@vger.kernel.org
Cc: chuck.lever@oracle.com
Subject: Re: [PATCH] NFSD: change LISTXATTRS cookie encoding to big-endian
Date: Thu, 25 Jan 2024 12:08:16 -0500	[thread overview]
Message-ID: <0789a389a803efe921cb1f02556cfd6f48cc09a5.camel@kernel.org> (raw)
In-Reply-To: <20240125144612.12778-1-mora@netapp.com>

On Thu, 2024-01-25 at 07:46 -0700, Jorge Mora wrote:
> Function nfsd4_listxattr_validate_cookie() expects the cookie
> as an offset to the list thus it needs to be encoded in big-endian.
> 
> Fixes: 23e50fe3a5e6 ("nfsd: implement the xattr functions and en/decode logic")
> Signed-off-by: Jorge Mora <mora@netapp.com>
> ---
>  fs/nfsd/nfs4xdr.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 26993bf368fc..913d566519bf 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -5142,6 +5142,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
>  	u64 cookie;
>  	char *sp;
>  	__be32 status, tmp;
> +	__be64 wire_cookie;
>  	__be32 *p;
>  	u32 nuser;
>  
> @@ -5235,7 +5236,8 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
>  
>  	cookie = offset + count;
>  
> -	write_bytes_to_xdr_buf(xdr->buf, cookie_offset, &cookie, 8);
> +	wire_cookie = cpu_to_be64(cookie);
> +	write_bytes_to_xdr_buf(xdr->buf, cookie_offset, &wire_cookie, 8);
>  	tmp = cpu_to_be32(count);
>  	write_bytes_to_xdr_buf(xdr->buf, count_offset, &tmp, 4);
>  out:

Reviewed-by: Jeff Layton <jlayton@kernel.org>

      reply	other threads:[~2024-01-25 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 14:46 [PATCH] NFSD: change LISTXATTRS cookie encoding to big-endian Jorge Mora
2024-01-25 17:08 ` Jeff Layton [this message]

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=0789a389a803efe921cb1f02556cfd6f48cc09a5.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jmora1300@gmail.com \
    --cc=linux-nfs@vger.kernel.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