* [PATCH v2] generic/020: fix really long attr test failure for ceph
@ 2023-02-27 4:13 xiubli
2023-02-27 4:16 ` Xiubo Li
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: xiubli @ 2023-02-27 4:13 UTC (permalink / raw)
To: fstests; +Cc: david, djwong, ceph-devel, vshankar, zlang, Xiubo Li
From: Xiubo Li <xiubli@redhat.com>
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>
---
V2:
- make the 'size' and the 'selinux_size' to be local
tests/generic/020 | 6 ++++--
1 file 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
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] generic/020: fix really long attr test failure for ceph
2023-02-27 4:13 [PATCH v2] generic/020: fix really long attr test failure for ceph xiubli
@ 2023-02-27 4:16 ` Xiubo Li
2023-02-27 9:41 ` Zorro Lang
2023-02-27 16:14 ` Bill O'Donnell
2 siblings, 0 replies; 4+ messages in thread
From: Xiubo Li @ 2023-02-27 4:16 UTC (permalink / raw)
To: fstests; +Cc: david, djwong, ceph-devel, vshankar, zlang
The test results of this:
[root@lxbceph1 xfstests-dev]# ./check generic/020
FSTYP -- ceph
PLATFORM -- Linux/x86_64 lxbceph1 6.2.0-rc7-00074-gd9ba97321a89
#211 SMP PREEMPT_DYNAMIC Wed Feb 22 14:28:15 CST 2023
MKFS_OPTIONS -- 10.72.47.117:40602:/testB
MOUNT_OPTIONS -- -o
test_dummy_encryption,name=admin,nowsync,copyfrom,rasize=4096 -o
context=system_u:object_r:root_t:s0 10.72.47.117:40602:/testB /mnt/kcephfs.B
generic/020 32s ... 34s
Ran: generic/020
Passed all 1 tests
On 27/02/2023 12:13, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
>
> 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>
> ---
>
> V2:
> - make the 'size' and the 'selinux_size' to be local
>
> tests/generic/020 | 6 ++++--
> 1 file 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
--
Best Regards,
Xiubo Li (李秀波)
Email: xiubli@redhat.com/xiubli@ibm.com
Slack: @Xiubo Li
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] generic/020: fix really long attr test failure for ceph
2023-02-27 4:13 [PATCH v2] generic/020: fix really long attr test failure for ceph xiubli
2023-02-27 4:16 ` Xiubo Li
@ 2023-02-27 9:41 ` Zorro Lang
2023-02-27 16:14 ` Bill O'Donnell
2 siblings, 0 replies; 4+ messages in thread
From: Zorro Lang @ 2023-02-27 9:41 UTC (permalink / raw)
To: xiubli; +Cc: fstests, ceph-devel
On Mon, Feb 27, 2023 at 12:13:58PM +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
>
> 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>
> ---
This version looks good to me,
Reviewed-by: Zorro Lang <zlang@redhat.com>
>
> V2:
> - make the 'size' and the 'selinux_size' to be local
>
> tests/generic/020 | 6 ++++--
> 1 file 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
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] generic/020: fix really long attr test failure for ceph
2023-02-27 4:13 [PATCH v2] generic/020: fix really long attr test failure for ceph xiubli
2023-02-27 4:16 ` Xiubo Li
2023-02-27 9:41 ` Zorro Lang
@ 2023-02-27 16:14 ` Bill O'Donnell
2 siblings, 0 replies; 4+ messages in thread
From: Bill O'Donnell @ 2023-02-27 16:14 UTC (permalink / raw)
To: xiubli; +Cc: fstests, david, djwong, ceph-devel, vshankar, zlang
On Mon, Feb 27, 2023 at 12:13:58PM +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
>
> 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>
> ---
LGTM
Reviewed-by Bill O'Donnell <bodonnel@redhat.com>
>
> V2:
> - make the 'size' and the 'selinux_size' to be local
>
> tests/generic/020 | 6 ++++--
> 1 file 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
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-27 16:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 4:13 [PATCH v2] generic/020: fix really long attr test failure for ceph xiubli
2023-02-27 4:16 ` Xiubo Li
2023-02-27 9:41 ` Zorro Lang
2023-02-27 16:14 ` Bill O'Donnell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.