public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Jan Polensky <japo@linux.ibm.com>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v4 2/2] setxattr02: Adapt test for kernel 7.1.0+ socket xattr support
Date: Wed, 18 Mar 2026 16:18:17 +0100	[thread overview]
Message-ID: <20260318151817.GC31214@pevik> (raw)
In-Reply-To: <20260318111306.98139-3-japo@linux.ibm.com>

Hi Jan,

> +static bool socket_xattr_supported;
> +
>  struct test_case {
>  	char *fname;
>  	char *key;
> @@ -57,7 +60,9 @@ struct test_case {
>  	int flags;
>  	int exp_err;
>  	int needskeyset;
> +	bool check_xattr;

Maybe more readable would be 'check_kver' (I can change it before merge).

>  };
> +
>  static struct test_case tc[] = {
>  	{			/* case 00, set attr to reg */
>  	 .fname = FILENAME,
> @@ -115,6 +120,7 @@ static struct test_case tc[] = {
>  	 .size = XATTR_TEST_VALUE_SIZE,
>  	 .flags = XATTR_CREATE,
>  	 .exp_err = EPERM,
> +	 .check_xattr = true,
>  	 },
>  };

> @@ -126,6 +132,9 @@ static void verify_setxattr(unsigned int i)
>  				XATTR_CREATE);
>  	}

> +	if (tc[i].check_xattr && socket_xattr_supported)
> +		tc[i].exp_err = 0;
> +
>  	TEST(setxattr(tc[i].fname, tc[i].key, tc[i].value, tc[i].size,
>  			tc[i].flags));

> @@ -185,6 +194,8 @@ static void setup(void)
>  	SAFE_MKNOD(CHR, S_IFCHR | 0777, dev);
>  	SAFE_MKNOD(BLK, S_IFBLK | 0777, 0);
>  	SAFE_MKNOD(SOCK, S_IFSOCK | 0777, 0);
> +
> +	socket_xattr_supported = (tst_kvercmp(7, 1, 0) >= 0);

Brackets are not needed (not a mistake, but I'll remove it before merge).

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

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

  reply	other threads:[~2026-03-18 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 11:13 [LTP] [PATCH v4 0/2] LTP: adjust socket xattr tests for kernel 7.1.0+ Jan Polensky
2026-03-18 11:13 ` [LTP] [PATCH v4 1/2] fsetxattr02: Adapt test for kernel 7.1.0+ socket xattr support Jan Polensky
2026-03-18 15:18   ` Petr Vorel
2026-03-18 11:13 ` [LTP] [PATCH v4 2/2] setxattr02: " Jan Polensky
2026-03-18 15:18   ` Petr Vorel [this message]
2026-03-20  9:32     ` Jan Polensky
2026-03-20  9:50 ` [LTP] [PATCH v4 0/2] LTP: adjust socket xattr tests for kernel 7.1.0+ Andrea Cervesato via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260318151817.GC31214@pevik \
    --to=pvorel@suse.cz \
    --cc=japo@linux.ibm.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox