[LTP] [PATCH 1/1] ioctl_ficlone03.c: Support test on more filesystems

Cyril Hrubis chrubis@suse.cz
Fri Jul 11 16:15:12 CEST 2025


Hi!
> +	/* ext[234] and tmpfs does not support immutable destination */
> +	if (errno_exp == EPERM &&
> +		(fs_type == TST_EXT234_MAGIC || fs_type == TST_TMPFS_MAGIC)) {

Maybe a bit better if (tc->dst_fd == immut_fd && ...)

> +		errno_exp = EOPNOTSUPP;
> +	}
>  
>  	TST_EXP_FAIL(ioctl(*tc->dst_fd, FICLONE, *tc->src_fd),
> -		tc->errno_exp,
> -		"%s", tc->msg);
> +		errno_exp, "%s", tc->msg);
>  
>  	clone_range->src_fd = *tc->src_fd;
>  
>  	TST_EXP_FAIL(ioctl(*tc->dst_fd, FICLONERANGE, clone_range),
> -		tc->errno_exp,
> -		"%s", tc->msg);
> +		errno_exp, "%s", tc->msg);
>  }
>  
>  static void setup(void)

I find it strange that we manage to set the FS_IMMUTABLE_FL in the setup
with the FS_IOC_SETFLAGS without any error. Maybe it would make sense to
check with ext devs what is going on here.

> @@ -117,6 +123,10 @@ static struct tst_test test = {
>  			.mkfs_ver = "mkfs.xfs >= 1.5.0",
>  			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
>  		},
> +		{.type = "ext2"},
> +		{.type = "ext3"},
> +		{.type = "ext4"},
> +		{.type = "tmpfs"},
>  		{}
>  	},
>  	.bufs = (struct tst_buffers []) {
> -- 
> 2.49.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list