[PATCH] generic/020: fix another really long attr test failure for ceph

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Xiubo Li <xiubli@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux