All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@kernel.org>
Cc: fstests@vger.kernel.org, ceph-devel@vger.kernel.org
Subject: Re: [PATCH] generic/020: fix really long attr test failure for ceph
Date: Tue, 21 Feb 2023 11:22:02 -0800	[thread overview]
Message-ID: <Y/UZ2mwahyPzYSMj@magnolia> (raw)
In-Reply-To: <20230218060436.534bnbs5znio5pd7@zlang-mailbox>

On Sat, Feb 18, 2023 at 02:04:36PM +0800, Zorro Lang wrote:
> On Fri, Feb 17, 2023 at 09:09:11AM -0800, Darrick J. Wong wrote:
> > On Fri, Feb 17, 2023 at 08:45:58PM +0800, xiubli@redhat.com wrote:
> > > From: Xiubo Li <xiubli@redhat.com>
> > > 
> > > If the CONFIG_CEPH_FS_SECURITY_LABEL is enabled the kernel ceph
> > > itself will set the security.selinux extended attribute to MDS.
> > > And it will also eat some space of the total size.
> > > 
> > > Fixes: https://tracker.ceph.com/issues/58742
> > > Signed-off-by: Xiubo Li <xiubli@redhat.com>
> > > ---
> > >  tests/generic/020 | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/tests/generic/020 b/tests/generic/020
> > > index be5cecad..594535b5 100755
> > > --- a/tests/generic/020
> > > +++ b/tests/generic/020
> > > @@ -150,9 +150,11 @@ _attr_get_maxval_size()
> > >  		# it imposes a maximum size for the full set of xattrs
> > >  		# names+values, which by default is 64K.  Compute the maximum
> > >  		# taking into account the already existing attributes
> > > -		max_attrval_size=$(getfattr --dump -e hex $filename 2>/dev/null | \
> > > +		size=$(getfattr --dump -e hex $filename 2>/dev/null | \
> > >  			awk -F "=0x" '/^user/ {len += length($1) + length($2) / 2} END {print len}')
> > > -		max_attrval_size=$((65536 - $max_attrval_size - $max_attrval_namelen))
> > > +		selinux_size=$(getfattr -n 'security.selinux' --dump -e hex $filename 2>/dev/null | \
> > > +			awk -F "=0x" '/^security/ {len += length($1) + length($2) / 2} END {print len}')
> > > +		max_attrval_size=$((65536 - $size - $selinux_size - $max_attrval_namelen))
> > 
> > If this is a ceph bug, then why is the change being applied to the
> > section for FSTYP=ext* ?  Why not create a case statement for ceph?
> 
> Hi Darrick,
> 
> Looks like this change is in ceph section [1], did you hit any errors when
> you merge it?

ahahaa, diff tried to merge that hunk into _attr_get_max and not
_attr_get_maxval_size, and I didn't notice.  Question withdrawn
with apologies. :/

--D

> Thanks,
> Zorro
> 
> [1]
> _attr_get_maxval_size()
> {
>         local max_attrval_namelen="$1"
>         local filename="$2"
> 
>         # Set max attr value size in bytes based on fs type
>         case "$FSTYP" in
>         ...
>         ...
>         ceph)
>                 # CephFS does not have a maximum value for attributes.  Instead,
>                 # it imposes a maximum size for the full set of xattrs
>                 # names+values, which by default is 64K.  Compute the maximum
>                 # taking into account the already existing attributes
> ====>           max_attrval_size=$(getfattr --dump -e hex $filename 2>/dev/null | \
>                         awk -F "=0x" '/^user/ {len += length($1) + length($2) / 2} END {print len}')
> ====>           max_attrval_size=$((65536 - $max_attrval_size - $max_attrval_namelen))
> 
> 
> 
> > 
> > --D
> > 
> > >  		;;
> > >  	*)
> > >  		# Assume max ~1 block of attrs
> > > -- 
> > > 2.31.1
> > > 
> > 

  reply	other threads:[~2023-02-21 19:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 12:45 [PATCH] generic/020: fix really long attr test failure for ceph xiubli
2023-02-17 17:09 ` Darrick J. Wong
2023-02-18  0:26   ` Xiubo Li
2023-02-18  6:04   ` Zorro Lang
2023-02-21 19:22     ` Darrick J. Wong [this message]
2023-02-22 14:15       ` Zorro Lang
2023-02-22 23:58         ` Xiubo Li
2023-02-27  4:14         ` 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=Y/UZ2mwahyPzYSMj@magnolia \
    --to=djwong@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=zlang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.