public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] Fix ioctl_ficlone on XFS without reflink support
Date: Thu, 26 Sep 2024 13:57:25 +0200	[thread overview]
Message-ID: <ZvVMJQhI_4tTFfYB@yuki.lan> (raw)
In-Reply-To: <20240924-ioctl_ficlone01_fix-v1-1-7741e2e13cc2@suse.com>

Hi!
> +static void setup(void)
> +{
> +	if (!strcmp(tst_device->fs_type, "xfs") && tst_kvercmp(4, 9, 0) < 0)
> +		tst_brk(TCONF, "XFS doesn't support reflink");
> +}
> +
>  static void cleanup(void)
>  {
>  	if (src_fd != -1)
> @@ -106,6 +112,7 @@ static void cleanup(void)
>  
>  static struct tst_test test = {
>  	.test_all = run,
> +	.setup = setup,
>  	.cleanup = cleanup,
>  	.min_kver = "4.5",
>  	.needs_root = 1,
> @@ -115,7 +122,7 @@ static struct tst_test test = {
>  		{.type = "bcachefs"},
>  		{.type = "btrfs"},
>  		{
> -			.type = "xfs",
> +			.type = "xfs >= 5.1.0",
>  			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
>  		},
>  		{}
> diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> index 3cc386c59..8e32ba039 100644
> --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> @@ -62,6 +62,9 @@ static void setup(void)
>  	int attr;
>  	struct stat sb;
>  
> +	if (!strcmp(tst_device->fs_type, "xfs") && tst_kvercmp(4, 9, 0) < 0)
> +		tst_brk(TCONF, "XFS doesn't support reflink");
> +
>  	rw_file = SAFE_OPEN("ok_only", O_CREAT | O_RDWR, 0640);
>  	ro_file = SAFE_OPEN("rd_only", O_CREAT | O_RDONLY, 0640);
>  	wo_file = SAFE_OPEN("rw_only", O_CREAT | O_WRONLY, 0640);
> @@ -113,7 +116,7 @@ static struct tst_test test = {
>  		{.type = "bcachefs"},
>  		{.type = "btrfs"},
>  		{
> -			.type = "xfs",
> +			.type = "xfs >= 5.1.0",

Does this even work? I suppose that we do have a minimal version syntax
for commands but not for mkfs.foo. And even for commands the version
parser needs to be implemented for each command separately. We have one
for mkfs.ext4 at the moment.

I suppose that we need to add .mkfs_ver string to the struct tst_fs and
possibly .kernel_ver as well so that we can add both checks to the
structures as:

	{
		.type = "xfs",
		.mkfs_ver = ">= 5.1.0",
		.kernel_ver = ">= 4.9.0",
		...
	}

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2024-09-26 11:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-24 12:53 [LTP] [PATCH] Fix ioctl_ficlone on XFS without reflink support Andrea Cervesato
2024-09-26 11:57 ` Cyril Hrubis [this message]
2024-09-26 14:58   ` Andrea Cervesato via ltp
2024-09-26 15:40     ` Cyril Hrubis
2024-09-27  7:44       ` Andrea Cervesato via ltp
2024-09-27  7:49         ` Cyril Hrubis
2024-09-27 14:41   ` Martin Doucha
2024-09-30  8:48     ` Cyril Hrubis
2024-09-30  8:53       ` Cyril Hrubis
2024-10-01 11:39     ` Cyril Hrubis

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=ZvVMJQhI_4tTFfYB@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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