From: David Disseldorp <ddiss@suse.de>
To: Dave Chinner <david@fromorbit.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] common/attr: reduce MAX_ATTRVAL_SIZE for NFS
Date: Mon, 11 Apr 2022 10:57:52 +0200 [thread overview]
Message-ID: <20220411105752.2b11cb15@suse.de> (raw)
In-Reply-To: <20220411054714.GI1609613@dread.disaster.area>
Thanks for the review, Dave...
On Mon, 11 Apr 2022 15:47:14 +1000, Dave Chinner wrote:
> > This is due to the MAX_ATTRVAL_SIZE=65536 setting for NFS, which exceeds
> > the Btrfs (and XFS) limit of MAX_ATTRVAL_SIZE=64. Change NFS to use this
> > lower bound value.
>
> I think that what XFS/UDF/BTRFS set here is bogus.
>
> There is *one* test - generic/020 - that uses MAX_ATTRS and
> MAX_ATTRVAL_SIZE, and it uses MAX_ATTRVAL_SIZE as a byte count.
>
> Which means for those 3 filesytems, the correct value for them is
> 65536, not 64....
>
> This looks like it was broken back when the test was made generic
> - the dd command before this used a bs=1024, so a maz size of 64
> would have been correct. Except the dd command also go changed to
> use bs=1, which meant 64 bytes....
>
> So, yeah, the test got "broken" for XFS back in 2012 and so the
> correct fix here is to change (at least) XFS and btrfs to have a
> MAX_ATTRVAL_SIZE=65536....
I'll change XFS over to use a 64K bytes limit. It looks like we'll need
a separate special case for Btrfs, as the size limit also takes the attr
name length into account:
79 int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode,
80 const char *name, const void *value, size_t size, int flags)
81 {
...
91 if (name_len + size > BTRFS_MAX_XATTR_SIZE(root->fs_info))
92 return -ENOSPC;
BTRFS_MAX_XATTR_SIZE() is also 16K by default on my test system. Given
that this is for generic/020 only, my plan is to turn the existing
MAX_ATTRVAL_SIZE logic into a helper function.
Cheers, David
next prev parent reply other threads:[~2022-04-11 8:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 19:19 [PATCH] common/attr: reduce MAX_ATTRVAL_SIZE for NFS David Disseldorp
2022-04-11 5:47 ` Dave Chinner
2022-04-11 8:57 ` David Disseldorp [this message]
2022-04-11 22:29 ` Dave Chinner
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=20220411105752.2b11cb15@suse.de \
--to=ddiss@suse.de \
--cc=david@fromorbit.com \
--cc=fstests@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