Linux NFS development
 help / color / mirror / Atom feed
From: Benjamin Coddington <bcodding@redhat.com>
To: Jorge Mora <jmora1300@gmail.com>
Cc: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com,
	anna@kernel.org
Subject: Re: [PATCH] NFSv4.2: fix listxattr maximum XDR buffer size
Date: Sat, 27 Jan 2024 08:01:56 -0500	[thread overview]
Message-ID: <2D2732BC-19AD-4010-9CB9-DA4C3BBBC31C@redhat.com> (raw)
In-Reply-To: <CAG7w-ioC8VkBFWqcaCw1S7YM-riNQKNUeu2-oUB4CpaimzB=7g@mail.gmail.com>

On 26 Jan 2024, at 15:37, Jorge Mora wrote:

> Thanks Ben,
>
> Do you want me to resubmit the patch using XDR_QUALEN? Something like this?
>
>  static inline u32 nfs42_listxattr_xdrsize(u32 buflen)
>  {
> -       return ((buflen / (XATTR_USER_PREFIX_LEN + 2)) * 8) + 4;
> +       u32 size = 8 * buflen / (XATTR_USER_PREFIX_LEN + 2) + 4;
> +
> +       return XDR_QUADLEN(size) << 2;

I just thought I'd mention it since it's used all over.  I think your
version is just fine.

Ben


      parent reply	other threads:[~2024-01-27 13:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 14:51 [PATCH] NFSv4.2: fix listxattr maximum XDR buffer size Jorge Mora
2024-01-26 13:48 ` Benjamin Coddington
     [not found]   ` <CAG7w-ioC8VkBFWqcaCw1S7YM-riNQKNUeu2-oUB4CpaimzB=7g@mail.gmail.com>
2024-01-27 13:01     ` Benjamin Coddington [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=2D2732BC-19AD-4010-9CB9-DA4C3BBBC31C@redhat.com \
    --to=bcodding@redhat.com \
    --cc=anna@kernel.org \
    --cc=jmora1300@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /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