summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2023-02-27 12:13:58 +0800
committerZorro Lang <zlang@kernel.org>2023-03-03 23:38:37 +0800
commitf7765774a1b5cb98c2f21a892e82b3421f40e791 (patch)
treea6d42b611eb8859a2cdc6fd06b54684ad710c98c
parentb3096c996a48960160b72738e5599df808a53260 (diff)
generic/020: fix really long attr test failure for cephv2023.03.05
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> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
-rwxr-xr-xtests/generic/0206
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/generic/020 b/tests/generic/020
index be5cecad..538a24c6 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 | \
+ local 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))
+ 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}')
+ max_attrval_size=$((65536 - $size - $selinux_size - $max_attrval_namelen))
;;
*)
# Assume max ~1 block of attrs