public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Luís Henriques" <lhenriques@suse.de>
Cc: fstests@vger.kernel.org, Jeff Layton <jlayton@kernel.org>,
	Xiubo Li <xiubli@redhat.com>,
	ceph-devel@vger.kernel.org
Subject: Re: [PATCH 1/2] generic/020: adjust max_attrval_size for ceph
Date: Thu, 9 Jun 2022 07:53:41 +1000	[thread overview]
Message-ID: <20220608215341.GU1098723@dread.disaster.area> (raw)
In-Reply-To: <YqBwAHhf8Bzk7VSa@suse.de>

On Wed, Jun 08, 2022 at 10:46:40AM +0100, Luís Henriques wrote:
> On Wed, Jun 08, 2022 at 10:16:42AM +1000, Dave Chinner wrote:
> > On Tue, Jun 07, 2022 at 04:15:12PM +0100, Luís Henriques wrote:
> > > CephFS doesn't had a maximum xattr size.  Instead, it imposes a maximum
> > > size for the full set of an inode's xattrs names+values, which by default
> > > is 64K but it can be changed by a cluster admin.
> > 
> > So given the max attr name length is fixed by the kernel at 255
> > bytes (XATTR_NAME_MAX), that means the max value length is somewhere
> > around 65000 bytes, not 1024 bytes?
> 
> Right, but if the name is smaller (and in this test specifically we're not
> using that XATTR_NAME_MAX), then that max value is > 65000.  Or if the
> file already has some attributes set (which is the case in this test),
> then this maximum will need to be adjusted accordingly.  (See below.)
> 
> > Really, we want to stress and exercise max supported sizes - if the
> > admin reduces the max size on their test filesystems, that's not
> > something we should be trying to work around in the test suite by
> > preventing the test code from ever exercising attr values > 1024
> > bytes.....
> 
> Agreed.  Xiubo also noted that and I also think this test shouldn't care
> about other values.  I should drop (or at least rephrase) the reference to
> different values in the commit text.
> 
> On Wed, Jun 08, 2022 at 04:41:25PM +0800, Xiubo Li wrote:
> ...
> > Why not fixing this by making sure that the total length of 'name' + 'value'
> > == 64K instead for ceph case ?
> 
> The reason why I didn't do that is because the $testfile *already* has
> another attribute set when we set this max value:
> 
> user.snrub="fish2\012"
> 
> which means that the maximum for this case will be:
> 
>  65536 - $max_attrval_namelen - strlen("user.snrub") - strlen("fish2\012")
> 
> I'll split the _attr_get_max() function in 2:
> 
>  * _attr_get_max() sets max_attrs which is needed in several places in
>    generic/020
>  * _attr_get_max_size() sets max_attrval_size, and gets called immediately
>    before that value is needed so that it can take into account the
>    current state.
> 
> Does this sound reasonable?

It seems like unnecessary additional complexity - keep it simple.
Just set the max size for ceph to ~65000 and add a comment that says
max name+val length for all ceph attrs is 64k and we need enough
space of that space for two attr names...


Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2022-06-08 21:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 15:15 [PATCH 0/2] Two xattrs-related fixes for ceph Luís Henriques
2022-06-07 15:15 ` [PATCH 1/2] generic/020: adjust max_attrval_size " Luís Henriques
2022-06-08  0:16   ` Dave Chinner
2022-06-08  9:46     ` Luís Henriques
2022-06-08 21:53       ` Dave Chinner [this message]
2022-06-09  9:09         ` Luís Henriques
2022-06-08  8:41   ` Xiubo Li
2022-06-07 15:15 ` [PATCH 2/2] src/attr_replace_test: dynamically adjust the max xattr size Luís Henriques
2022-06-07 15:33   ` Darrick J. Wong
2022-06-07 16:20     ` Luís Henriques
2022-06-07 16:51       ` [PATCH v2] " Luís Henriques
2022-06-08  1:17         ` Xiubo Li
2022-06-08  0:23   ` [PATCH 2/2] " Dave Chinner
2022-06-08  9:57     ` Luís Henriques
2022-06-08 21:59       ` Dave Chinner
2022-06-09 10:32         ` Luís Henriques
2022-06-08  8:50   ` Xiubo Li

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=20220608215341.GU1098723@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=jlayton@kernel.org \
    --cc=lhenriques@suse.de \
    --cc=xiubli@redhat.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