]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/020: fix another really long attr test failure for ceph
authorXiubo Li <xiubli@redhat.com>
Sun, 19 Mar 2023 06:29:27 +0000 (14:29 +0800)
committerZorro Lang <zlang@kernel.org>
Sat, 25 Mar 2023 04:37:54 +0000 (12:37 +0800)
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 <xiubli@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/020

index 538a24c61bf2df14e0549a7ed0b298d0c9e42165..e00365a9a61166e0e9367a41ec12c4fb1b7ceeae 100755 (executable)
@@ -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))
                ;;
        *)