ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] generic/020: fix another really long attr test failure for ceph
@ 2023-03-19  6:29 xiubli
  2023-03-21 14:26 ` Zorro Lang
  0 siblings, 1 reply; 2+ messages in thread
From: xiubli @ 2023-03-19  6:29 UTC (permalink / raw)
  To: fstests; +Cc: david, djwong, ceph-devel, zlang, vshankar, Xiubo Li

From: Xiubo Li <xiubli@redhat.com>

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] generic/020: fix another really long attr test failure for ceph
  2023-03-19  6:29 [PATCH] generic/020: fix another really long attr test failure for ceph xiubli
@ 2023-03-21 14:26 ` Zorro Lang
  0 siblings, 0 replies; 2+ messages in thread
From: Zorro Lang @ 2023-03-21 14:26 UTC (permalink / raw)
  To: xiubli; +Cc: fstests, ceph-devel

On Sun, Mar 19, 2023 at 02:29:27PM +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> 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>
> ---

Makes sense to me,
Reviewed-by: Zorro Lang <zlang@redhat.com>

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-21 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-19  6:29 [PATCH] generic/020: fix another really long attr test failure for ceph xiubli
2023-03-21 14:26 ` Zorro Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).