Skip to content

Commit

Permalink
generic/020: fix another really long attr test failure for ceph
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lxbsz authored and Zorro Lang committed Mar 25, 2023
1 parent 02200cb commit 2d7d5f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/generic/020
Original file line number Diff line number Diff line change
Expand Up @@ -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))
;;
*)
Expand Down

0 comments on commit 2d7d5f4

Please sign in to comment.