[LTP] [PATCH] refluxfs: Check kernel reflink support before mount

Martin Doucha mdoucha@suse.cz
Thu Aug 13 15:49:39 CEST 2026


On 8/13/26 12:46, Andrea Cervesato wrote:
> Hi Cyril,
> 
> Something like this?
> 
> diff --git a/lib/safe_macros.c b/lib/safe_macros.c
> index f95c5fdc5..34430d018 100644
> --- a/lib/safe_macros.c
> +++ b/lib/safe_macros.c
> @@ -993,9 +993,15 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
>   			"mount.%s failed with %i", filesystemtype, rval);
>   		return -1;
>   	} else if (rval == -1) {
> -		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
> -			"mount(%s, %s, %s, %lu, %p) failed", source, target,
> -			filesystemtype, mountflags, data);
> +		if (errno == EOPNOTSUPP) {
> +			tst_brkm_(file, lineno, TCONF | TERRNO, cleanup_fn,
> +				"mount(%s, %s, %s, %lu, %p) failed with EOPNOTSUPP", source, target,
> +				filesystemtype, mountflags, data);
> +		} else {
> +			tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
> +				"mount(%s, %s, %s, %lu, %p) failed", source, target,
> +				filesystemtype, mountflags, data);
> +		}
>   	} else {
>   		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
>   			"Invalid mount(%s, %s, %s, %lu, %p) return value %d",

Hi,
yes, but I think it'd be better to add a setting to struct tst_test to 
enable this TCONF check only for specific tests. By default, EOPNOTSUPP 
should still trigger TBROK.

Something like:
.mount_check_support = 1

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


More information about the ltp mailing list