public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1 0/3] LTP: adjust socket xattr tests for kernel 7.0+; add .editorconfig
@ 2026-03-09 17:20 Jan Polensky
  2026-03-09 17:20 ` [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support Jan Polensky
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jan Polensky @ 2026-03-09 17:20 UTC (permalink / raw)
  To: chrubis, pvorel; +Cc: Linux Test Project

Linux 7.0 allows user.* xattrs on sockets (dc0876b9846d). Update
fsetxattr02/setxattr02 to expect success on 7.0+ (instead of -EPERM).

Add .editorconfig for consistent formatting.

Jan Polensky (3):
  fsetxattr02: Adapt test for kernel 7.0+ socket xattr support
  setxattr02: Adapt test for kernel 7.0+ socket xattr support
  editorconfig: add consistent formatting rules for LTP

 .editorconfig                                 | 36 +++++++++++++++++++
 .../kernel/syscalls/fsetxattr/fsetxattr02.c   |  4 +++
 .../kernel/syscalls/setxattr/setxattr02.c     |  4 +++
 3 files changed, 44 insertions(+)
 create mode 100644 .editorconfig

--
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support
  2026-03-09 17:20 [LTP] [PATCH v1 0/3] LTP: adjust socket xattr tests for kernel 7.0+; add .editorconfig Jan Polensky
@ 2026-03-09 17:20 ` Jan Polensky
  2026-03-10 13:25   ` Petr Vorel
  2026-03-09 17:20 ` [LTP] [PATCH v1 2/3] setxattr02: " Jan Polensky
  2026-03-09 17:20 ` [LTP] [PATCH v1 3/3] editorconfig: add consistent formatting rules for LTP Jan Polensky
  2 siblings, 1 reply; 8+ messages in thread
From: Jan Polensky @ 2026-03-09 17:20 UTC (permalink / raw)
  To: chrubis, pvorel; +Cc: Linux Test Project

Starting with kernel 7.0.0, sockets support extended attributes in the
user.* namespace. This behavior was enabled by dc0876b9846d ("xattr: support
extended attributes on sockets"), which permits user.* xattrs on S_IFSOCK
inodes (previously rejected with -EPERM).

Adapts the test to expect success (exp_err = 0) instead of EPERM when
testing fsetxattr(2) on sockets with kernel 7.0+.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---
 testcases/kernel/syscalls/fsetxattr/fsetxattr02.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
index 18490a865871..ede86b218ee6 100644
--- a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
+++ b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
@@ -158,6 +158,10 @@ static void verify_fsetxattr(unsigned int i)
 	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
 		tst_brk(TCONF, "fsetxattr(2) not supported");
 
+	/* consider newer kernels */
+	if ((tst_kvercmp(7, 0, 0) >= 0) && (strncmp(tc[i].fname, SOCK, strlen(SOCK)) == 0))
+		tc[i].exp_err = 0;
+
 	/* success */
 
 	if (!tc[i].exp_err) {
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [PATCH v1 2/3] setxattr02: Adapt test for kernel 7.0+ socket xattr support
  2026-03-09 17:20 [LTP] [PATCH v1 0/3] LTP: adjust socket xattr tests for kernel 7.0+; add .editorconfig Jan Polensky
  2026-03-09 17:20 ` [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support Jan Polensky
@ 2026-03-09 17:20 ` Jan Polensky
  2026-03-09 17:20 ` [LTP] [PATCH v1 3/3] editorconfig: add consistent formatting rules for LTP Jan Polensky
  2 siblings, 0 replies; 8+ messages in thread
From: Jan Polensky @ 2026-03-09 17:20 UTC (permalink / raw)
  To: chrubis, pvorel; +Cc: Linux Test Project

Starting with kernel 7.0.0, sockets support extended attributes in the
user.* namespace. This behavior was enabled by dc0876b9846d ("xattr:
support extended attributes on sockets"), which permits user.* xattrs on
S_IFSOCK inodes (previously rejected with -EPERM).

Adapts the test to expect success (exp_err = 0) instead of EPERM when
testing setxattr(2) on sockets with kernel 7.0+.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---
 testcases/kernel/syscalls/setxattr/setxattr02.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/testcases/kernel/syscalls/setxattr/setxattr02.c b/testcases/kernel/syscalls/setxattr/setxattr02.c
index 9f5f998da9ba..ac2ad8678d31 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr02.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr02.c
@@ -132,6 +132,10 @@ static void verify_setxattr(unsigned int i)
 	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
 		tst_brk(TCONF, "setxattr(2) not supported");
 
+	/* consider newer kernels */
+	if ((tst_kvercmp(7, 0, 0) >= 0) && (strncmp(tc[i].fname, SOCK, strlen(SOCK)) == 0))
+		tc[i].exp_err = 0;
+
 	/* success */
 
 	if (!tc[i].exp_err) {
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [PATCH v1 3/3] editorconfig: add consistent formatting rules for LTP
  2026-03-09 17:20 [LTP] [PATCH v1 0/3] LTP: adjust socket xattr tests for kernel 7.0+; add .editorconfig Jan Polensky
  2026-03-09 17:20 ` [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support Jan Polensky
  2026-03-09 17:20 ` [LTP] [PATCH v1 2/3] setxattr02: " Jan Polensky
@ 2026-03-09 17:20 ` Jan Polensky
  2026-03-10 13:22   ` Petr Vorel
  2 siblings, 1 reply; 8+ messages in thread
From: Jan Polensky @ 2026-03-09 17:20 UTC (permalink / raw)
  To: chrubis, pvorel; +Cc: Linux Test Project

Introduce .editorconfig to keep indentation and whitespace consistent across
editors, preventing accidental reformatting and noisy diffs.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---
 .editorconfig | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..ee9f49516e53
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+# EditorConfig configuration for LTP
+# https://editorconfig.org/
+
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+# C/Assembly source files, headers, and Makefiles use tabs
+[*.{c,h,mk,S,sh,awk}]
+indent_style = tab
+indent_size = 8
+
+[{Makefile,Makefile.*}]
+indent_style = tab
+indent_size = 8
+
+# Python and Perl scripts use spaces
+[*.{py,pl}]
+indent_style = space
+indent_size = 4
+
+# Documentation files
+[*.{rst,md}]
+indent_style = space
+indent_size = 3
+
+# JSON files
+[*.json]
+indent_style = space
+indent_size = 4
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 3/3] editorconfig: add consistent formatting rules for LTP
  2026-03-09 17:20 ` [LTP] [PATCH v1 3/3] editorconfig: add consistent formatting rules for LTP Jan Polensky
@ 2026-03-10 13:22   ` Petr Vorel
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2026-03-10 13:22 UTC (permalink / raw)
  To: Jan Polensky; +Cc: Linux Test Project

Hi Jan,

> Introduce .editorconfig to keep indentation and whitespace consistent across
> editors, preventing accidental reformatting and noisy diffs.

+1, I was thinking about adding it looking on kernel [1] and Buildroot [2]
config some time ago.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/.editorconfig
[2] https://github.com/buildroot/buildroot/blob/master/.editorconfig

Generally LGTM.

BTW I would separate this from the actual code change (not relevant).

> Signed-off-by: Jan Polensky <japo@linux.ibm.com>
> ---
>  .editorconfig | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>  create mode 100644 .editorconfig

> diff --git a/.editorconfig b/.editorconfig
> new file mode 100644
> index 000000000000..ee9f49516e53
> --- /dev/null
> +++ b/.editorconfig
> @@ -0,0 +1,36 @@
> +# SPDX-License-Identifier: GPL-2.0-only

Any particular reason for GPL v2 only? The default LTP license is
GPL-2.0-or-later.

> +
> +# EditorConfig configuration for LTP
> +# https://editorconfig.org/
> +
> +root = true
> +
> +[*]
> +charset = utf-8
> +end_of_line = lf
> +insert_final_newline = true
> +trim_trailing_whitespace = true
> +
> +# C/Assembly source files, headers, and Makefiles use tabs
> +[*.{c,h,mk,S,sh,awk}]
FYI we have only single awk file which IMHO nobody uses (it may be deleted):
testcases/open_posix_testsuite/scripts/print-pass-fail-summary.awk
> +indent_style = tab
> +indent_size = 8
When we use tab anyway (i.e. it's about how is the tab displayed), could it be
indent_size = 4 ?
> +
> +[{Makefile,Makefile.*}]
nit: we should probably add here *.mk.in

> +indent_style = tab
> +indent_size = 8
> +
> +# Python and Perl scripts use spaces
> +[*.{py,pl}]
> +indent_style = space
> +indent_size = 4
Most of our python based tests contain tabs, see testcases/network/nfsv4/acl/
and testcases/realtime/func/pi-tests/.
OTOH doc/conf.py would have to be converted to tabs.

Also on perl it's hard to even decide, because vendored scripts/checkpatch.pl
uses tabs (and we modify it), but vendored scripts/checkbashisms.pl uses spaces.

> +
> +# Documentation files
> +[*.{rst,md}]
> +indent_style = space
> +indent_size = 3
If this setup is used for e.g. code block, than I would say we should have
indent_size = 4 to match the actual doc (doc/developers/test_case_tutorial.rst).

> +
> +# JSON files
> +[*.json]
> +indent_style = space
> +indent_size = 4
I'm ok with it, but our JSON files (tests added by Cyril) might be reformatted.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support
  2026-03-09 17:20 ` [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support Jan Polensky
@ 2026-03-10 13:25   ` Petr Vorel
  2026-03-10 13:36     ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2026-03-10 13:25 UTC (permalink / raw)
  To: Jan Polensky; +Cc: Linux Test Project

Hi Jan,

> Starting with kernel 7.0.0, sockets support extended attributes in the
> user.* namespace. This behavior was enabled by dc0876b9846d ("xattr: support
> extended attributes on sockets"), which permits user.* xattrs on S_IFSOCK
> inodes (previously rejected with -EPERM).

Good catch, thanks!
Reviewed-by: Petr Vorel <pvorel@suse.cz>

> Adapts the test to expect success (exp_err = 0) instead of EPERM when
> testing fsetxattr(2) on sockets with kernel 7.0+.

> Signed-off-by: Jan Polensky <japo@linux.ibm.com>
> ---
>  testcases/kernel/syscalls/fsetxattr/fsetxattr02.c | 4 ++++
>  1 file changed, 4 insertions(+)

> diff --git a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
> index 18490a865871..ede86b218ee6 100644
> --- a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
> +++ b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
> @@ -158,6 +158,10 @@ static void verify_fsetxattr(unsigned int i)
>  	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
>  		tst_brk(TCONF, "fsetxattr(2) not supported");

> +	/* consider newer kernels */
very nit: The commit is obvious. If anything to add, I would add the git hash itself.

Kind regards,
Petr

> +	if ((tst_kvercmp(7, 0, 0) >= 0) && (strncmp(tc[i].fname, SOCK, strlen(SOCK)) == 0))
> +		tc[i].exp_err = 0;
> +
>  	/* success */

>  	if (!tc[i].exp_err) {

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support
  2026-03-10 13:25   ` Petr Vorel
@ 2026-03-10 13:36     ` Petr Vorel
  2026-03-11 14:54       ` Jan Polensky
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2026-03-10 13:36 UTC (permalink / raw)
  To: Jan Polensky, chrubis, Linux Test Project

Hi Jan,

> Hi Jan,

> > Starting with kernel 7.0.0, sockets support extended attributes in the
> > user.* namespace. This behavior was enabled by dc0876b9846d ("xattr: support
> > extended attributes on sockets"), which permits user.* xattrs on S_IFSOCK
> > inodes (previously rejected with -EPERM).

I double checked kernel version for dc0876b9846d.

$ git tag --contains dc0876b9846d3d48bb8528332106d1b051578a02
next-20260305
next-20260306
next-20260309

=> IMHO it will be for v7.1. And indeed, current LTP master works on openSUSE
7.0.0-rc2-2.g0bfc1b0-default kernel and fails with your patch.

> Good catch, thanks!
> Reviewed-by: Petr Vorel <pvorel@suse.cz>

> > Adapts the test to expect success (exp_err = 0) instead of EPERM when
> > testing fsetxattr(2) on sockets with kernel 7.0+.

> > Signed-off-by: Jan Polensky <japo@linux.ibm.com>
> > ---
> >  testcases/kernel/syscalls/fsetxattr/fsetxattr02.c | 4 ++++
> >  1 file changed, 4 insertions(+)

> > diff --git a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
> > index 18490a865871..ede86b218ee6 100644
> > --- a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
> > +++ b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
> > @@ -158,6 +158,10 @@ static void verify_fsetxattr(unsigned int i)
> >  	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
> >  		tst_brk(TCONF, "fsetxattr(2) not supported");

> > +	/* consider newer kernels */
> very nit: The commit is obvious. If anything to add, I would add the git hash itself.

> Kind regards,
> Petr

> > +	if ((tst_kvercmp(7, 0, 0) >= 0) && (strncmp(tc[i].fname, SOCK, strlen(SOCK)) == 0))
> > +		tc[i].exp_err = 0;

It should be tst_kvercmp(7, 1, 0) >= 0

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support
  2026-03-10 13:36     ` Petr Vorel
@ 2026-03-11 14:54       ` Jan Polensky
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Polensky @ 2026-03-11 14:54 UTC (permalink / raw)
  To: Petr Vorel, chrubis, Linux Test Project

On Tue, Mar 10, 2026 at 02:36:39PM +0100, Petr Vorel wrote:
Hi Peter,
> Hi Jan,
>
> > Hi Jan,
>
[snip]
>
> I double checked kernel version for dc0876b9846d.
>
> $ git tag --contains dc0876b9846d3d48bb8528332106d1b051578a02
> next-20260305
> next-20260306
> next-20260309
>
> => IMHO it will be for v7.1. And indeed, current LTP master works on openSUSE
> 7.0.0-rc2-2.g0bfc1b0-default kernel and fails with your patch.
>
[snip]
>
> It should be tst_kvercmp(7, 1, 0) >= 0
>
> Kind regards,
> Petr
thank you for the hints. I’ll take them all into account, revise the
patches accordingly, and send out a v2 shortly.


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-03-11 14:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 17:20 [LTP] [PATCH v1 0/3] LTP: adjust socket xattr tests for kernel 7.0+; add .editorconfig Jan Polensky
2026-03-09 17:20 ` [LTP] [PATCH v1 1/3] fsetxattr02: Adapt test for kernel 7.0+ socket xattr support Jan Polensky
2026-03-10 13:25   ` Petr Vorel
2026-03-10 13:36     ` Petr Vorel
2026-03-11 14:54       ` Jan Polensky
2026-03-09 17:20 ` [LTP] [PATCH v1 2/3] setxattr02: " Jan Polensky
2026-03-09 17:20 ` [LTP] [PATCH v1 3/3] editorconfig: add consistent formatting rules for LTP Jan Polensky
2026-03-10 13:22   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox