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 2A367C6FD1F for ; Sun, 19 Mar 2023 06:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjCSGbO (ORCPT ); Sun, 19 Mar 2023 02:31:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbjCSGbN (ORCPT ); Sun, 19 Mar 2023 02:31:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE794E39D for ; Sat, 18 Mar 2023 23:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679207410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oQdoYneqxB38oSnnXNvER25kilgSQblF3svLTyKprLQ=; b=TpGVHoKLLHgQXsKGTxaoUwDEEr0rwhBKV61Mlk1fmnXmW9T4QAdau13AdkdB93TOEO1ooo KY/JcrAFMmI/wDJ7l3g1AuGe7o1faBaqrKmYJI78GfunTAJWCxeO5kQZ9cpUrnNw4Y33Yz c7BbZMqatn1dYTb77c9568ed8imuy7I= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-314-5rrFs7nzNIOfAZ0MHRqnlQ-1; Sun, 19 Mar 2023 02:30:08 -0400 X-MC-Unique: 5rrFs7nzNIOfAZ0MHRqnlQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 641943C0252E; Sun, 19 Mar 2023 06:30:08 +0000 (UTC) Received: from lxbceph1.gsslab.pek2.redhat.com (unknown [10.72.47.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99EF5C15BA0; Sun, 19 Mar 2023 06:30:00 +0000 (UTC) From: xiubli@redhat.com To: fstests@vger.kernel.org Cc: david@fromorbit.com, djwong@kernel.org, ceph-devel@vger.kernel.org, zlang@redhat.com, vshankar@redhat.com, Xiubo Li Subject: [PATCH] generic/020: fix another really long attr test failure for ceph Date: Sun, 19 Mar 2023 14:29:27 +0800 Message-Id: <20230319062928.278235-1-xiubli@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Xiubo Li If the CONFIG_CEPH_FS_SECURITY_LABEL is disabled the kernel ceph the 'selinux_size' will be empty and then: max_attrval_size=$((65536 - $size - $selinux_size - $max_attrval_namelen)) will be: max_attrval_size=$((65536 - $size - - $max_attrval_namelen)) which equals to: max_attrval_size=$((65536 - $size + $max_attrval_namelen)) Signed-off-by: Xiubo Li --- tests/generic/020 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/generic/020 b/tests/generic/020 index 538a24c6..e00365a9 100755 --- a/tests/generic/020 +++ b/tests/generic/020 @@ -154,6 +154,12 @@ _attr_get_maxval_size() awk -F "=0x" '/^user/ {len += length($1) + length($2) / 2} END {print len}') local 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}') + if [ -z $size ]; then + size=0 + fi + if [ -z $selinux_size ]; then + selinux_size=0 + fi max_attrval_size=$((65536 - $size - $selinux_size - $max_attrval_namelen)) ;; *) -- 2.31.1