From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 975D0C433EF for ; Fri, 10 Jun 2022 13:06:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232167AbiFJNGJ (ORCPT ); Fri, 10 Jun 2022 09:06:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242513AbiFJNGI (ORCPT ); Fri, 10 Jun 2022 09:06:08 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BBE92BE3; Fri, 10 Jun 2022 06:06:05 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 09CE51FD3A; Fri, 10 Jun 2022 13:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1654866364; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aKJb2yfH7WGTf4bCkt05kUuUeC65zU/vhDKvaMT0Dhs=; b=2Lqshp+AZ7LtqYFPiXjc4+U3ZmuwncXJtZHTAQFPvBH0sruiKuWJY68JWBJ799eQ4GMhB1 7gch7yZ6hjvoNU1u+fWUHcVdkyF5j28cVWZ2+9whTllbgMENeOVyKY8nrrbgB+dipiymDe PhBx5b+bU16hjusKZoEf3WAG1zvOwMA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1654866364; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aKJb2yfH7WGTf4bCkt05kUuUeC65zU/vhDKvaMT0Dhs=; b=q1msuJilxTSJ+eh7iSO+Qqz9V8XQl91RfV3ffsI6OgIypNQ+q7s+PsPXsh7c+hUW12/wKs SD5jCZQh4j6ut9BA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8AAB913941; Fri, 10 Jun 2022 13:06:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zl3zHrtBo2K4QAAAMHmgww (envelope-from ); Fri, 10 Jun 2022 13:06:03 +0000 Received: from localhost (orpheu.olymp [local]) by orpheu.olymp (OpenSMTPD) with ESMTPA id c5f5b6f9; Fri, 10 Jun 2022 14:06:01 +0100 (WEST) From: Luis Henriques To: Xiubo Li Cc: David Disseldorp , fstests@vger.kernel.org, Dave Chinner , "Darrick J. Wong" , Jeff Layton , ceph-devel@vger.kernel.org Subject: Re: [PATCH v2 1/2] generic/020: adjust max_attrval_size for ceph References: <20220609105343.13591-1-lhenriques@suse.de> <20220609105343.13591-2-lhenriques@suse.de> <20220609162109.23883b71@suse.de> Date: Fri, 10 Jun 2022 14:06:01 +0100 In-Reply-To: (Xiubo Li's message of "Fri, 10 Jun 2022 08:47:09 +0800") Message-ID: <87k09ou0qu.fsf@orpheu.olymp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Xiubo Li writes: > On 6/9/22 10:21 PM, David Disseldorp wrote: >> Hi Lu=C3=ADs, >> >> On Thu, 9 Jun 2022 11:53:42 +0100, Lu=C3=ADs Henriques wrote: >> >>> CephFS doesn't have a maximum xattr size. Instead, it imposes a maximum >>> size for the full set of xattrs names+values, which by default is 64K. >>> >>> This patch fixes the max_attrval_size so that it is slightly < 64K in >>> order to accommodate any already existing xattrs in the file. >>> >>> Signed-off-by: Lu=C3=ADs Henriques >>> --- >>> tests/generic/020 | 10 +++++++++- >>> 1 file changed, 9 insertions(+), 1 deletion(-) >>> >>> diff --git a/tests/generic/020 b/tests/generic/020 >>> index d8648e96286e..76f13220fe85 100755 >>> --- a/tests/generic/020 >>> +++ b/tests/generic/020 >>> @@ -128,7 +128,7 @@ _attr_get_max() >>> pvfs2) >>> max_attrval_size=3D8192 >>> ;; >>> - xfs|udf|9p|ceph) >>> + xfs|udf|9p) >>> max_attrval_size=3D65536 >>> ;; >>> bcachefs) >>> @@ -139,6 +139,14 @@ _attr_get_max() >>> # the underlying filesystem, so just use the lowest value above. >>> max_attrval_size=3D1024 >>> ;; >>> + 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. Set this to a value >>> + # that is slightly smaller than 64K so that it can accommodate >>> + # already existing xattrs. >>> + max_attrval_size=3D65000 >>> + ;; >> I take it a more exact calculation would be something like: >> (64K - $max_attrval_namelen - sizeof(user.snrub=3D"fish2\012"))? > > Yeah, something like this looks better to me. Right, it could be hard-coded. But we'd need to take into account that the attribute value may not be ascii. That's why my initial attempt to fix this was to decode everything in hex. > I am afraid without reaching up to the real max size we couldn't test the= real > bugs out from ceph. Such as the bug you fixed in ceph Locker.cc code. OK, I'll change this to use the exact value. Thanks, Xiubo. Cheers, --=20 Luis > >> Perhaps you could calculate this on the fly for CephFS by passing in the >> filename and subtracting the `getfattr -d $filename` results... That >> said, it'd probably get a bit ugly, expecially if encoding needs to be >> taken into account. >> >> Reviewed-by: David Disseldorp >> >> Cheers, David >> >